okumin commented on code in PR #5036:
URL: https://github.com/apache/hive/pull/5036#discussion_r1650252690


##########
standalone-metastore/metastore-server/src/main/sql/hive/hive-schema-4.1.0.hive.sql:
##########
@@ -1592,6 +1592,57 @@ WHERE
     AND
     B.PARAM_KEY LIKE 'repl_metrics%';
 
+CREATE EXTERNAL TABLE IF NOT EXISTS `PROTO_HIVE_QUERY_DATA`
+PARTITIONED BY (
+  `date` string
+)
+ROW FORMAT SERDE 'org.apache.hadoop.hive.ql.io.protobuf.ProtobufMessageSerDe'
+STORED AS INPUTFORMAT 
'org.apache.hadoop.hive.ql.io.protobuf.ProtobufMessageInputFormat'
+OUTPUTFORMAT 'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
+LOCATION '_REPLACE_WITH_QUERY_DATA_LOCATION_'
+TBLPROPERTIES (
+  
'proto.class'='org.apache.hadoop.hive.ql.hooks.proto.HiveHookEvents$HiveHookEventProto',
+  'proto.maptypes'='org.apache.hadoop.hive.ql.hooks.proto.MapFieldEntry'
+);

Review Comment:
   I pulled this branch, ran schematool, and am checking the behavior. Any 
partitions don't appear for me unless I add partitions by hand. Is this an 
expected behavior?
   
   ```
   schematool -metaDbType derby -dbType hive -initSchema -url 
jdbc:hive2://hive-hiveserver2:10000/default -driver 
org.apache.hive.jdbc.HiveDriver
   ```
   
   ```
   0: jdbc:hive2://hive-hiveserver2:10000/defaul> show partitions 
sys.PROTO_HIVE_QUERY_DATA;
   ...
   +------------+
   | partition  |
   +------------+
   +------------+
   ```
   
   Manual ADD PARTITION makes my data visible.
   
   ```
   0: jdbc:hive2://hive-hiveserver2:10000/defaul> ALTER TABLE 
sys.PROTO_HIVE_QUERY_DATA ADD PARTITION (`date`='2024-06-23') LOCATION 
'hdfs:///tmp/hive-proto/date=2024-06-23';
   ...
   0: jdbc:hive2://hive-hiveserver2:10000/defaul> select count(*) from 
sys.PROTO_HIVE_QUERY_DATA;
   ...
   +------+
   | _c0  |
   +------+
   | 83   |
   +------+
   ...
   ```
   
   



-- 
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-unsubscr...@hive.apache.org

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


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

Reply via email to