[ 
https://issues.apache.org/jira/browse/HIVE-26687?focusedWorklogId=841847&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-841847
 ]

ASF GitHub Bot logged work on HIVE-26687:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 26/Jan/23 20:15
            Start Date: 26/Jan/23 20:15
    Worklog Time Spent: 10m 
      Work Description: soumyakanti3578 commented on code in PR #3923:
URL: https://github.com/apache/hive/pull/3923#discussion_r1088298367


##########
ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java:
##########
@@ -8722,8 +8722,18 @@ private ExprNodeDesc handleConversion(StructField 
tableField, ColumnInfo rowFiel
       // need to do some conversions here
       conversion.set(true);
       if (tableFieldTypeInfo.getCategory() != Category.PRIMITIVE) {
-        // cannot convert to complex types
-        column = null;
+        // handle array in case of complex types
+        String array_type_prefix = "array<";

Review Comment:
   nit: For variable names, please use CamelCase. 





Issue Time Tracking
-------------------

    Worklog Id:     (was: 841847)
    Time Spent: 40m  (was: 0.5h)

> INSERT query with array<smallint> type failing with SemanticException
> ---------------------------------------------------------------------
>
>                 Key: HIVE-26687
>                 URL: https://issues.apache.org/jira/browse/HIVE-26687
>             Project: Hive
>          Issue Type: Bug
>          Components: Hive
>    Affects Versions: 4.0.0
>            Reporter: Manthan B Y
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 40m
>  Remaining Estimate: 0h
>
> *Steps to reproduce:*
> {code:java}
> DROP TABLE IF EXISTS default.tbl_oGSJ;
> CREATE TABLE default.tbl_oGSJ (c1 array<smallint>);
> INSERT INTO default.tbl_oGSJ(c1) VALUES (array(55,54)); {code}
> *Error:*
> {code:java}
> Error: Error while compiling statement: FAILED: SemanticException Line 0:-1 
> Cannot insert into target table because column number/types are different 
> 'TOK_TMP_FILE': Cannot convert column 0 from array<int> to array<smallint>. 
> (state=42000,code=40000) {code}
> The same is the case for bigint, tinyint as well



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to