Uploaded image for project: 'IMPALA'
  1. IMPALA
  2. IMPALA-9639

[DOC]:Document Impala support for Kudu DATE type

    XMLWordPrintableJSON

Details

    • Documentation
    • Status: Closed
    • Major
    • Resolution: Fixed
    • Not Applicable
    • Not Applicable
    • Docs
    • ghx-label-1

    Description

      See IMPALA-8800, reading and writing DATE values
      to Kudu tables. Date is in the 3.4 branch. 
      Include some examples from Dev's checkin:

      ---- QUERY
      # create table with primary key of DATE type
      create table kudu_date_key (fdatekey date primary key, val string)
      stored as kudu
      ---- RESULTS
      'Table has been created.'
      ---- ERRORS
      Unpartitioned Kudu tables are inefficient for large data sizes.
      ====
      ---- QUERY
      insert into kudu_date_key values (DATE '1970-01-01', 'Unix epoch'), (DATE '2019-12-12', 'today')
      ---- RUNTIME_PROFILE
      NumModifiedRows: 2
      NumRowErrors: 0
      ---- LABELS
      FDATEKEY,VAL
      ---- DML_RESULTS: kudu_date_key
      1970-01-01,'Unix epoch'
      2019-12-12,'today'
      ---- TYPES
      DATE,STRING
      ====
      ---- QUERY
      # create table with DATE primary key partitioned by range
      create table kudu_datepk_range (fdate DATE not null primary key)
      partition by range (fdate)
      (
        partition values < DATE '1900-01-01',
        partition DATE '1900-01-01' <= values < DATE '1970-01-01',
        partition DATE '1970-01-01' <= values < DATE '2000-01-01',
        partition DATE '2000-01-01' <= values
      )
      stored as kudu
      ---- RESULTS
      'Table has been created.'
      ====
      ---- QUERY
      insert into kudu_datepk_range values
        (DATE '1800-01-01'),
        (DATE '1970-01-01'),
        (DATE '2019-12-12')
      ---- RUNTIME_PROFILE
      NumModifiedRows: 3
      NumRowErrors: 0
      ---- LABELS
      FDATE
      ---- DML_RESULTS: kudu_datepk_range
      1800-01-01
      1970-01-01
      2019-12-12
      ---- TYPES
      
      DATE
      ====
      ---- QUERY
      select * from kudu_datepk_range;
      ---- RESULTS
      1800-01-01
      1970-01-01
      2019-12-12
      ---- TYPES
      DATE
      ====---- QUERY# Test date columns and primary keycreate table describe_date_test( date_pk date PRIMARY KEY, date_val date not null, date_null date null)stored as kudu;describe describe_date_test;---- LABELSNAME,TYPE,COMMENT,PRIMARY_KEY,NULLABLE,DEFAULT_VALUE,ENCODING,COMPRESSION,BLOCK_SIZE---- RESULTS'date_pk','date','','true','false','','AUTO_ENCODING','DEFAULT_COMPRESSION','0''date_val','date','','false','false','','AUTO_ENCODING','DEFAULT_COMPRESSION','0''date_null','date','','false','true','','AUTO_ENCODING','DEFAULT_COMPRESSION','0'---- TYPESSTRING
      ====
      

      Attachments

        Issue Links

          Activity

            People

              krishahn Kris Hahn
              krishahn Kris Hahn
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: