Details
-
Bug
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
1.12.3, 1.14.4
-
None
-
None
Description
Create table in hive catalog with the following sql state. :
CREATE TABLE user_score( username varchar, score varchar, proctime AS PROCTIME() ) with ( 'connector'='datagen', 'rows-per-second'='2', 'fields.score.length'='2', 'fields.username.length'='2' );
We can get the description:
DESCRIBE user_score; +----------+-----------------------------+-------+-----+---------------+-----------+ | name | type | null | key | extras | watermark | +----------+-----------------------------+-------+-----+---------------+-----------+ | username | STRING | true | | | | | score | STRING | true | | | | | proctime | TIMESTAMP_LTZ(3) *PROCTIME* | false | | AS PROCTIME() | | +----------+-----------------------------+-------+-----+---------------+-----------+
However,view create in hive catalog will lost Time attribute in the proctime field:
create view view_score_hive_catalog as select * from user_score;
DESCRIBE view_score_hive_catalog; +----------+------------------+-------+-----+--------+-----------+ | name | type | null | key | extras | watermark | +----------+------------------+-------+-----+--------+-----------+ | username | STRING | true | | | | | score | STRING | true | | | | | proctime | TIMESTAMP_LTZ(3) | false | | | | +----------+------------------+-------+-----+--------+-----------+
Otherwise,when we excute the same state. in default catalog, things are going to change:
Create view view_score_mem_catalog as select * from myhive.[hive_database].user_score;
DESCRIBE view_score_mem_catalog; +----------+-----------------------------+-------+-----+--------+-----------+ | name | type | null | key | extras | watermark | +----------+-----------------------------+-------+-----+--------+-----------+ | username | STRING | true | | | | | score | STRING | true | | | | | proctime | TIMESTAMP_LTZ(3) *PROCTIME* | false | | | | +----------+-----------------------------+-------+-----+--------+-----------+