Login  Register

[GitHub] [carbondata] maheshrajus commented on a change in pull request #4154: [CARBONDATA-4214] inserting NULL value when timestamp value received from FROM_UNIXTIME(0)

Posted by GitBox on Jun 18, 2021; 9:00pm
URL: http://apache-carbondata-dev-mailing-list-archive.168.s1.nabble.com/GitHub-carbondata-maheshrajus-opened-a-new-pull-request-4154-WIP-inserting-NULL-value-when-timestamp-tp108975p108965.html


maheshrajus commented on a change in pull request #4154:
URL: https://github.com/apache/carbondata/pull/4154#discussion_r654374684



##########
File path: integration/spark/src/test/scala/org/apache/carbondata/spark/testsuite/allqueries/AllDataTypesTestCase.scala
##########
@@ -73,6 +75,21 @@ class AllDataTypesTestCase extends QueryTest with BeforeAndAfterAll {
     }
   }
 
+  test("insert data with from_unixtime(0) and query") {
+    sql("drop table if exists time_carbon1")
+    sql("create table if not exists time_carbon1(time1 timestamp) stored as carbondata")
+    sql("insert into time_carbon1 select from_unixtime(0)")

Review comment:
       ok

##########
File path: integration/spark/src/main/scala/org/apache/spark/sql/execution/command/management/CommonLoadUtils.scala
##########
@@ -781,9 +781,8 @@ object CommonLoadUtils {
         internalRowOriginal
       }
       for (index <- timeStampIndex) {
-        if (internalRow.getLong(index) == 0) {
-          internalRow.setNullAt(index)
-        } else {
+        // if value zero case spark will fill the timestamp. no need to fill null

Review comment:
       ok




--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[hidden email]