You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@carbondata.apache.org by GitBox <gi...@apache.org> on 2021/06/18 21:00:09 UTC

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

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:
users@infra.apache.org