You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by GitBox <gi...@apache.org> on 2022/03/28 13:00:57 UTC

[GitHub] [hive] pvary opened a new pull request #3147: HIVE-26077: Implement CTAS for Iceberg tables with partition spec

pvary opened a new pull request #3147:
URL: https://github.com/apache/hive/pull/3147


   ### What changes were proposed in this pull request?
   Implements the following query:
   ```
   CREATE TABLE t PARTITIONED BY SPEC(day(ts)) AS SELECT ...
   ```
   
   ### Why are the changes needed?
   We need to have a way to create a table with the spec
   
   ### Does this PR introduce _any_ user-facing change?
   Implements a new syntax
   
   ### How was this patch tested?
   New unit test


-- 
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.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] marton-bod commented on a change in pull request #3147: HIVE-26077: Implement CTAS for Iceberg tables with partition spec

Posted by GitBox <gi...@apache.org>.
marton-bod commented on a change in pull request #3147:
URL: https://github.com/apache/hive/pull/3147#discussion_r837220839



##########
File path: iceberg/iceberg-handler/src/test/java/org/apache/iceberg/mr/hive/HiveIcebergTestUtils.java
##########
@@ -299,12 +300,14 @@ public static void validateDataWithSQL(TestHiveShell shell, String tableName, Li
       Assert.assertEquals(record.size(), row.length);
       for (int j = 0; j < record.size(); ++j) {
         Object field = record.get(j);
-        if (field instanceof LocalDateTime) {
+        if (field == null) {
+          Assert.assertNull(row[j]);
+        } else if (field instanceof LocalDateTime) {
           Assert.assertEquals(((LocalDateTime) field).toInstant(ZoneOffset.UTC).toEpochMilli(),
               TimestampUtils.stringToTimestamp((String) row[j]).toEpochMilli());
         } else if (field instanceof OffsetDateTime) {
           Assert.assertEquals(((OffsetDateTime) field).toInstant().toEpochMilli(),
-              TimestampTZUtil.parse((String) row[j]).toEpochMilli());
+              TimestampTZUtil.parse((String) row[j], ZoneId.systemDefault()).toEpochMilli());

Review comment:
       Did you get a failure without specifying the the zone?




-- 
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.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] pvary commented on a change in pull request #3147: HIVE-26077: Implement CTAS for Iceberg tables with partition spec

Posted by GitBox <gi...@apache.org>.
pvary commented on a change in pull request #3147:
URL: https://github.com/apache/hive/pull/3147#discussion_r837233568



##########
File path: iceberg/iceberg-handler/src/test/java/org/apache/iceberg/mr/hive/HiveIcebergTestUtils.java
##########
@@ -299,12 +300,14 @@ public static void validateDataWithSQL(TestHiveShell shell, String tableName, Li
       Assert.assertEquals(record.size(), row.length);
       for (int j = 0; j < record.size(); ++j) {
         Object field = record.get(j);
-        if (field instanceof LocalDateTime) {
+        if (field == null) {
+          Assert.assertNull(row[j]);
+        } else if (field instanceof LocalDateTime) {
           Assert.assertEquals(((LocalDateTime) field).toInstant(ZoneOffset.UTC).toEpochMilli(),
               TimestampUtils.stringToTimestamp((String) row[j]).toEpochMilli());
         } else if (field instanceof OffsetDateTime) {
           Assert.assertEquals(((OffsetDateTime) field).toInstant().toEpochMilli(),
-              TimestampTZUtil.parse((String) row[j]).toEpochMilli());
+              TimestampTZUtil.parse((String) row[j], ZoneId.systemDefault()).toEpochMilli());

Review comment:
       Yeah. Without that, if the string does not contain the TZ, then `TimestampTZUtil.parse` does not know which TZ it should use in parsing




-- 
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.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] pvary merged pull request #3147: HIVE-26077: Implement CTAS for Iceberg tables with partition spec

Posted by GitBox <gi...@apache.org>.
pvary merged pull request #3147:
URL: https://github.com/apache/hive/pull/3147


   


-- 
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.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org