[ 
https://issues.apache.org/jira/browse/SPARK-31048?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Hyukjin Kwon resolved SPARK-31048.
----------------------------------
    Resolution: Incomplete

2.2.2 is EOL release. Can you try this in Spark 2.4?

> alter hive column datatype is not supported
> -------------------------------------------
>
>                 Key: SPARK-31048
>                 URL: https://issues.apache.org/jira/browse/SPARK-31048
>             Project: Spark
>          Issue Type: Bug
>          Components: Spark Shell, SQL
>    Affects Versions: 2.2.2
>         Environment: spark sql with hive metadata store.
>            Reporter: Sunil Aryal
>            Priority: Major
>              Labels: test
>
> describe tb2;
> Getting log thread is interrupted, since query is done!
> +-----------------+-----------------+-----------------+--+
> | col_name | data_type | comment |
> +-----------------+-----------------+-----------------+--+
> | fn | int | NULL |
> | ln | string | NULL |
> | age | int | NULL |
> | # Partition Information | | |
> | # col_name | data_type | comment |
> | age | int | NULL |
> +-----------------+-----------------+-----------------+--+
> 6 rows selected (0.213 seconds)
>  alter table tb2 change fn fn bigint;
> Getting log thread is interrupted, since query is done!
> Error: org.apache.spark.sql.AnalysisException: ALTER TABLE CHANGE COLUMN is 
> not supported for changing column 'fn' with type 'IntegerType' to 'fn' with 
> type 'LongType'; (state=,code=0)
> java.sql.SQLException: org.apache.spark.sql.AnalysisException: ALTER TABLE 
> CHANGE COLUMN is not supported for changing column 'fn' with type 
> 'IntegerType' to 'fn' with type 'LongType';
>  at org.apache.hive.jdbc.HiveStatement.execute(HiveStatement.java:296)
>  at org.apache.hive.beeline.Commands.execute(Commands.java:848)
>  at org.apache.hive.beeline.Commands.sql(Commands.java:713)
>  at org.apache.hive.beeline.BeeLine.dispatch(BeeLine.java:973)
>  at org.apache.hive.beeline.BeeLine.execute(BeeLine.java:813)
>  at org.apache.hive.beeline.BeeLine.begin(BeeLine.java:771)
>  at org.apache.hive.beeline.BeeLine.mainWithInputRedirection(BeeLine.java:484)
>  at org.apache.hive.beeline.BeeLine.main(BeeLine.java:467)



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to