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 2020/02/28 23:11:49 UTC

[GitHub] [hive] vineetgarg02 opened a new pull request #928: HIVE-21778 CBO: "Struct is not null" gets evaluated as `nullable` always causing filter miss in the query

vineetgarg02 opened a new pull request #928: HIVE-21778 CBO: "Struct is not null" gets evaluated as `nullable` always causing filter miss in the query
URL: https://github.com/apache/hive/pull/928
 
 
   

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


With regards,
Apache Git Services

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


[GitHub] [hive] vineetgarg02 closed pull request #928: HIVE-21778 CBO: "Struct is not null" gets evaluated as `nullable` always causing filter miss in the query

Posted by GitBox <gi...@apache.org>.
vineetgarg02 closed pull request #928: HIVE-21778 CBO: "Struct is not null" gets evaluated as `nullable` always causing filter miss in the query
URL: https://github.com/apache/hive/pull/928
 
 
   

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


With regards,
Apache Git Services

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


[GitHub] [hive] vineetgarg02 commented on a change in pull request #928: HIVE-21778 CBO: "Struct is not null" gets evaluated as `nullable` always causing filter miss in the query

Posted by GitBox <gi...@apache.org>.
vineetgarg02 commented on a change in pull request #928: HIVE-21778 CBO: "Struct is not null" gets evaluated as `nullable` always causing filter miss in the query
URL: https://github.com/apache/hive/pull/928#discussion_r386574132
 
 

 ##########
 File path: ql/src/test/queries/clientpositive/structin.q
 ##########
 @@ -21,3 +21,14 @@ IN (
 struct('1234-1111-0074578664','3'),
 struct('1234-1111-0074578695',1)
 );
+
+CREATE TABLE test_struct
+(
+  f1 string,
+  demo_struct struct<f1:string, f2:string, f3:string>,
+  datestr string
+);
+
 
 Review comment:
   I am unable to add a `null` value into struct column. `cast as <struct>` doesn't work. I have added a test to insert someone data.

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


With regards,
Apache Git Services

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


[GitHub] [hive] jcamachor commented on a change in pull request #928: HIVE-21778 CBO: "Struct is not null" gets evaluated as `nullable` always causing filter miss in the query

Posted by GitBox <gi...@apache.org>.
jcamachor commented on a change in pull request #928: HIVE-21778 CBO: "Struct is not null" gets evaluated as `nullable` always causing filter miss in the query
URL: https://github.com/apache/hive/pull/928#discussion_r386134508
 
 

 ##########
 File path: ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/translator/ASTBuilder.java
 ##########
 @@ -243,6 +243,7 @@ public static ASTNode literal(RexLiteral literal) {
     case INTERVAL_SECOND:
     case INTERVAL_YEAR:
     case INTERVAL_YEAR_MONTH:
+    case ROW:
 
 Review comment:
   `ROW` is missing in the type switch in L267. AFAIK it makes sense because ROW type could only be a literal if it is NULL. However, can we add it at the end of the switch with a short comment so we recall this (e.g., as it was done with `BINARY`)?

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


With regards,
Apache Git Services

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


[GitHub] [hive] jcamachor commented on a change in pull request #928: HIVE-21778 CBO: "Struct is not null" gets evaluated as `nullable` always causing filter miss in the query

Posted by GitBox <gi...@apache.org>.
jcamachor commented on a change in pull request #928: HIVE-21778 CBO: "Struct is not null" gets evaluated as `nullable` always causing filter miss in the query
URL: https://github.com/apache/hive/pull/928#discussion_r386134721
 
 

 ##########
 File path: ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/translator/TypeConverter.java
 ##########
 @@ -160,7 +160,7 @@ public static RelDataType convert(TypeInfo type, RelDataTypeFactory dtFactory)
       convertedType = convert((UnionTypeInfo) type, dtFactory);
       break;
     }
-    return convertedType;
+    return dtFactory.createTypeWithNullability(convertedType, true);
 
 Review comment:
   This makes sense because Hive does not have a concept of not nullable type. Can we add a comment?

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


With regards,
Apache Git Services

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


[GitHub] [hive] jcamachor commented on a change in pull request #928: HIVE-21778 CBO: "Struct is not null" gets evaluated as `nullable` always causing filter miss in the query

Posted by GitBox <gi...@apache.org>.
jcamachor commented on a change in pull request #928: HIVE-21778 CBO: "Struct is not null" gets evaluated as `nullable` always causing filter miss in the query
URL: https://github.com/apache/hive/pull/928#discussion_r386135020
 
 

 ##########
 File path: ql/src/test/queries/clientpositive/structin.q
 ##########
 @@ -21,3 +21,14 @@ IN (
 struct('1234-1111-0074578664','3'),
 struct('1234-1111-0074578695',1)
 );
+
+CREATE TABLE test_struct
+(
+  f1 string,
+  demo_struct struct<f1:string, f2:string, f3:string>,
+  datestr string
+);
+
 
 Review comment:
   Can we insert a few rows here and add the SELECT query? Just in case that `IS NOT NULL` predicate in the explain goes away with a future change, we do not confuse it with an optimization.

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


With regards,
Apache Git Services

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