Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-27641

Create view lost Time attribute in Hive Catalog

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 1.12.3, 1.14.4
    • None
    • Connectors / Hive
    • 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 |     |        |           |
      +----------+-----------------------------+-------+-----+--------+-----------+
      

       

       

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            wudi1205 Robert Wu
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: