soumyakanti3578 commented on code in PR #5494:
URL: https://github.com/apache/hive/pull/5494#discussion_r1803810002


##########
ql/src/test/results/clientpositive/llap/jdbc_filter_expand_row_operator.q.out:
##########
@@ -0,0 +1,41 @@
+PREHOOK: query: CREATE EXTERNAL TABLE book (id int, title varchar(100), author 
int)
+STORED BY 'org.apache.hive.storage.jdbc.JdbcStorageHandler'
+TBLPROPERTIES (
+    "hive.sql.database.type" = "POSTGRES",
+    "hive.sql.jdbc.driver" = "org.postgresql.Driver",
+    "hive.sql.jdbc.url" = "jdbc:postgresql://localhost:5432/qtestDB",
+    "hive.sql.dbcp.username" = "qtestuser",
+    "hive.sql.dbcp.password" = "qtestpassword",
+    "hive.sql.table" = "book")
+PREHOOK: type: CREATETABLE
+PREHOOK: Output: database:default
+PREHOOK: Output: default@book
+POSTHOOK: query: CREATE EXTERNAL TABLE book (id int, title varchar(100), 
author int)
+STORED BY 'org.apache.hive.storage.jdbc.JdbcStorageHandler'
+TBLPROPERTIES (
+    "hive.sql.database.type" = "POSTGRES",
+    "hive.sql.jdbc.driver" = "org.postgresql.Driver",
+    "hive.sql.jdbc.url" = "jdbc:postgresql://localhost:5432/qtestDB",
+    "hive.sql.dbcp.username" = "qtestuser",
+    "hive.sql.dbcp.password" = "qtestpassword",
+    "hive.sql.table" = "book")
+POSTHOOK: type: CREATETABLE
+POSTHOOK: Output: database:default
+POSTHOOK: Output: default@book
+PREHOOK: query: explain cbo
+select * from book 
+where id = 0 or (id = 1 and author = 11) or (id = 2 and author = 22)
+PREHOOK: type: QUERY
+PREHOOK: Input: default@book
+#### A masked pattern was here ####
+POSTHOOK: query: explain cbo
+select * from book 
+where id = 0 or (id = 1 and author = 11) or (id = 2 and author = 22)
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@book
+#### A masked pattern was here ####
+CBO PLAN:
+HiveJdbcConverter(convention=[JDBC.POSTGRES])
+  JdbcFilter(condition=[AND(OR(=($0, 0), AND(=($0, 1), =($2, 11)), AND(=($0, 
2), =($2, 22))), IN($0, 0, 1, 2))])

Review Comment:
   It definitely seems redundant, but this could be out of scope of this PR as 
this is present in the non jdbc plan as well: 
[cbo_query47.q.out](https://github.com/apache/hive/blob/b4dd5cfba418097f69ff533e3a57da4f2c95fc46/ql/src/test/results/clientpositive/perf/tpcds30tb/tez/cbo_query47.q.out#L30)
   
   Ideally, for the condition in 
[cbo_query47.q](https://github.com/apache/hive/blob/b4dd5cfba418097f69ff533e3a57da4f2c95fc46/ql/src/test/queries/clientpositive/perf/cbo_query47.q#L23):
   ```
            d_year = 2000 or
            ( d_year = 2000-1 and d_moy =12) or
            ( d_year = 2000+1 and d_moy =1)
   ```
   `OR(=($6, 2000), IN(ROW($6, $8), ROW(1999, 12), ROW(2001, 1)))` should have 
been sufficient. Not sure why we have the extra `IN($6, 2000, 1999, 2001)`, but 
I will try to look into it.



-- 
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: [email protected]

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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to