[GitHub] carbondata pull request #1322: [CARBONDATA-1450] Support timestamp more than...

2017-09-18 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/carbondata/pull/1322


---


[GitHub] carbondata pull request #1322: [CARBONDATA-1450] Support timestamp more than...

2017-09-18 Thread dhatchayani
Github user dhatchayani commented on a diff in the pull request:

https://github.com/apache/carbondata/pull/1322#discussion_r139395991
  
--- Diff: 
core/src/main/java/org/apache/carbondata/core/scan/executor/util/RestructureUtil.java
 ---
@@ -211,10 +213,21 @@ private static Object 
getDirectDictionaryDefaultValue(DataType dataType, byte[]
* @param defaultValue
* @return
*/
-  private static Object getNoDictionaryDefaultValue(byte[] defaultValue) {
+  private static Object getNoDictionaryDefaultValue(DataType datatype, 
byte[] defaultValue) {
 Object noDictionaryDefaultValue = null;
 if (!isDefaultValueNull(defaultValue)) {
-  noDictionaryDefaultValue = UTF8String.fromBytes(defaultValue);
+  switch (datatype) {
+case INT:
+  noDictionaryDefaultValue = ByteUtil.toInt(defaultValue, 0, 
defaultValue.length);
+  break;
+case LONG:
+case TIMESTAMP:
+  long timestampValue = ByteUtil.toLong(defaultValue, 0, 
defaultValue.length);
--- End diff --

handled


---


[GitHub] carbondata pull request #1322: [CARBONDATA-1450] Support timestamp more than...

2017-09-18 Thread dhatchayani
Github user dhatchayani commented on a diff in the pull request:

https://github.com/apache/carbondata/pull/1322#discussion_r139395822
  
--- Diff: 
integration/spark-common-test/src/test/scala/org/apache/carbondata/spark/testsuite/sortcolumns/TestSortColumns.scala
 ---
@@ -31,6 +31,42 @@ class TestSortColumns extends QueryTest with 
BeforeAndAfterAll {
 sql(s"""LOAD DATA local inpath '$resourcesPath/data.csv' INTO TABLE 
origintable1 OPTIONS('DELIMITER'= ',', 'QUOTECHAR'= '\"')""")
   }
 
+  test("create table sort columns dictionary include - int") {
--- End diff --

added


---


[GitHub] carbondata pull request #1322: [CARBONDATA-1450] Support timestamp more than...

2017-09-18 Thread gvramana
Github user gvramana commented on a diff in the pull request:

https://github.com/apache/carbondata/pull/1322#discussion_r139389587
  
--- Diff: 
integration/spark-common-test/src/test/scala/org/apache/carbondata/spark/testsuite/sortcolumns/TestSortColumns.scala
 ---
@@ -31,6 +31,42 @@ class TestSortColumns extends QueryTest with 
BeforeAndAfterAll {
 sql(s"""LOAD DATA local inpath '$resourcesPath/data.csv' INTO TABLE 
origintable1 OPTIONS('DELIMITER'= ',', 'QUOTECHAR'= '\"')""")
   }
 
+  test("create table sort columns dictionary include - int") {
--- End diff --

Add test cases for Int and Long no-Dictionary cases


---


[GitHub] carbondata pull request #1322: [CARBONDATA-1450] Support timestamp more than...

2017-09-18 Thread gvramana
Github user gvramana commented on a diff in the pull request:

https://github.com/apache/carbondata/pull/1322#discussion_r139386365
  
--- Diff: 
core/src/main/java/org/apache/carbondata/core/scan/executor/util/RestructureUtil.java
 ---
@@ -211,10 +213,21 @@ private static Object 
getDirectDictionaryDefaultValue(DataType dataType, byte[]
* @param defaultValue
* @return
*/
-  private static Object getNoDictionaryDefaultValue(byte[] defaultValue) {
+  private static Object getNoDictionaryDefaultValue(DataType datatype, 
byte[] defaultValue) {
 Object noDictionaryDefaultValue = null;
 if (!isDefaultValueNull(defaultValue)) {
-  noDictionaryDefaultValue = UTF8String.fromBytes(defaultValue);
+  switch (datatype) {
+case INT:
+  noDictionaryDefaultValue = ByteUtil.toInt(defaultValue, 0, 
defaultValue.length);
+  break;
+case LONG:
+case TIMESTAMP:
+  long timestampValue = ByteUtil.toLong(defaultValue, 0, 
defaultValue.length);
--- End diff --

Here Long case to be separately handled.


---


[GitHub] carbondata pull request #1322: [CARBONDATA-1450] Support timestamp more than...

2017-09-05 Thread dhatchayani
GitHub user dhatchayani opened a pull request:

https://github.com/apache/carbondata/pull/1322

[CARBONDATA-1450] Support timestamp more than 68 years, Enhance NoDic…



You can merge this pull request into a Git repository by running:

$ git pull https://github.com/dhatchayani/incubator-carbondata 
timestamp_support

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/carbondata/pull/1322.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #1322


commit e33fb0be76b4f6127f95e1ab49c782363f017e37
Author: dhatchayani 
Date:   2017-09-05T10:24:28Z

[CARBONDATA-1450] Support timestamp more than 68 years, Enhance 
NoDictionary Datatypes - int , long




---