Uploaded image for project: 'CarbonData'
  1. CarbonData
  2. CARBONDATA-1360

Update is not working properly for complex datatype

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 1.1.1
    • Fix Version/s: None
    • Component/s: sql
    • Labels:
      None
    • Environment:
      Spark 2.1

      Description

      Steps to reproduce :

      create table STRUCT_OF_ARRAY_update1 (CUST_ID string, YEAR int, MONTH int, AGE int, GENDER string, EDUCATED string, IS_MARRIED string, STRUCT_OF_ARRAY struct<ID: int,CHECK_DATE: timestamp,SNo: array<int>,sal1: array<double>,state: array<string>,date1: array<timestamp>>,CARD_COUNT int,DEBIT_COUNT int, CREDIT_COUNT int, DEPOSIT double, HQ_DEPOSIT double) STORED BY 'org.apache.carbondata.format' TBLPROPERTIES('NO_INVERTED_INDEX'='STRUCT_OF_ARRAY');
      ---------+

      Result

      ---------+
      ---------+
      No rows selected (1.137 seconds)

      LOAD DATA INPATH 'hdfs://localhost:54311/BabuStore/TestData/Data/complex/structofarray.csv' INTO table STRUCT_OF_ARRAY_update1 options ('DELIMITER'=',', 'QUOTECHAR'='"', 'FILEHEADER'='CUST_ID,YEAR,MONTH,AGE,GENDER,EDUCATED,IS_MARRIED,STRUCT_OF_ARRAY,CARD_COUNT,DEBIT_COUNT,CREDIT_COUNT,DEPOSIT,HQ_DEPOSIT','COMPLEX_DELIMITER_LEVEL_1'='$','COMPLEX_DELIMITER_LEVEL_2'='&');
      ---------+

      Result

      ---------+
      ---------+
      No rows selected (3.82 seconds)

      update STRUCT_OF_ARRAY_update1 set(struct_of_array)=('

      {"ID":123457790,"CHECK_DATE":null,"SNo":[1099,3000],"sal1":[1099.123,3999.234],"state":["United States","HI"],"date1":[null,null]}

      ,77,112,145,4.123030672E8,7.028563114E8') where cust_id in ('Cust00000000000000000999') ;
      ---------+

      Result

      ---------+
      ---------+
      No rows selected (3.329 seconds)

      select struct_of_array from STRUCT_OF_ARRAY_update1 where cust_id in ('Cust00000000000000000999') ;
      -----------------------------------------------------------------------------------------+

      struct_of_array

      -----------------------------------------------------------------------------------------+

      {"ID":null,"CHECK_DATE":null,"SNo":[null],"sal1":[null],"state":[null],"date1":[null]}

      -----------------------------------------------------------------------------------------+
      1 row selected (0.433 seconds)

      No column of Structure gets updated

      When we update query using this query :

      0: jdbc:hive2://localhost:10000> update STRUCT_OF_ARRAY_update1 set(struct_of_array)=(8) ;
      ---------+

      Result

      ---------+
      ---------+
      No rows selected (2.82 seconds)
      0: jdbc:hive2://localhost:10000> select struct_of_array from STRUCT_OF_ARRAY_update1 where cust_id in ('Cust00000000000000000999') ;
      --------------------------------------------------------------------------------------+

      struct_of_array

      --------------------------------------------------------------------------------------+

      {"ID":8,"CHECK_DATE":null,"SNo":[null],"sal1":[null],"state":[null],"date1":[null]}

      --------------------------------------------------------------------------------------+
      1 row selected (0.191 seconds)

      1st column of Structure gets updated

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Ashwini.krishnakumar Ashwini K
                Reporter:
                swati.rao SWATI RAO
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 3h 50m
                  3h 50m