carbondata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ravipes...@apache.org
Subject [31/50] [abbrv] carbondata git commit: [CARBONDATA-2015] Restricted maximum length of bytes per column
Date Sun, 28 Jan 2018 06:46:00 GMT
[CARBONDATA-2015] Restricted maximum length of bytes per column

Validation for number of bytes for a column is added.

This closes #1813


Project: http://git-wip-us.apache.org/repos/asf/carbondata/repo
Commit: http://git-wip-us.apache.org/repos/asf/carbondata/commit/770deb82
Tree: http://git-wip-us.apache.org/repos/asf/carbondata/tree/770deb82
Diff: http://git-wip-us.apache.org/repos/asf/carbondata/diff/770deb82

Branch: refs/heads/fgdatamap
Commit: 770deb8208f75bb0d3cec3e5688de2e15d1570eb
Parents: 6094af6
Author: dhatchayani <dhatcha.official@gmail.com>
Authored: Tue Jan 16 15:48:32 2018 +0530
Committer: manishgupta88 <tomanishgupta18@gmail.com>
Committed: Wed Jan 17 11:42:06 2018 +0530

----------------------------------------------------------------------
 .../converter/impl/NonDictionaryFieldConverterImpl.java  | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/carbondata/blob/770deb82/processing/src/main/java/org/apache/carbondata/processing/loading/converter/impl/NonDictionaryFieldConverterImpl.java
----------------------------------------------------------------------
diff --git a/processing/src/main/java/org/apache/carbondata/processing/loading/converter/impl/NonDictionaryFieldConverterImpl.java
b/processing/src/main/java/org/apache/carbondata/processing/loading/converter/impl/NonDictionaryFieldConverterImpl.java
index 504d2f5..ced37dd 100644
--- a/processing/src/main/java/org/apache/carbondata/processing/loading/converter/impl/NonDictionaryFieldConverterImpl.java
+++ b/processing/src/main/java/org/apache/carbondata/processing/loading/converter/impl/NonDictionaryFieldConverterImpl.java
@@ -70,13 +70,14 @@ public class NonDictionaryFieldConverterImpl implements FieldConverter
{
       try {
         byte[] value = DataTypeUtil
             .getBytesBasedOnDataTypeForNoDictionaryColumn(dimensionValue, dataType, dateFormat);
-        if (dataType == DataTypes.STRING) {
-          assert value.length <= CarbonCommonConstants.MAX_CHARS_PER_COLUMN_DEFAULT;
+        if (dataType == DataTypes.STRING
+            && value.length > CarbonCommonConstants.MAX_CHARS_PER_COLUMN_DEFAULT)
{
+          throw new CarbonDataLoadingException("Dataload failed, String size cannot exceed
"
+              + CarbonCommonConstants.MAX_CHARS_PER_COLUMN_DEFAULT + " bytes");
         }
         row.update(value, index);
-      } catch (AssertionError ae) {
-        throw new CarbonDataLoadingException("Dataload failed, String size cannot exceed
"
-            + CarbonCommonConstants.MAX_CHARS_PER_COLUMN_DEFAULT + " bytes");
+      } catch (CarbonDataLoadingException e) {
+        throw e;
       } catch (Throwable ex) {
         if (dimensionValue.length() > 0 || (dimensionValue.length() == 0 && isEmptyBadRecord))
{
           String message = logHolder.getColumnMessageMap().get(column.getColName());


Mime
View raw message