To add more information:

I also tried:

EnvironmentContext context = new EnvironmentContext();
context.setProperties(ImmutableMap.of("hive.metastore.disallow.incompatible.col.type.changes",
"false"));
client.alter_table_with_environment_context(hiveSchema,
table.getTableName(), table, context);

I get the same error:

InvalidOperationException(message:The following columns have types
incompatible with the existing columns in their respective positions :
redacted_col_name)

The stack trace is:

InvalidOperationException(message:The following columns have types
incompatible with the existing columns in their respective positions :
redacted_col_name)
at
org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$alter_table_with_environment_context_result$alter_table_with_environment_context_resultStandardScheme.read(ThriftHiveMetastore.java:39794)
at
org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$alter_table_with_environment_context_result$alter_table_with_environment_context_resultStandardScheme.read(ThriftHiveMetastore.java:39780)
at
org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$alter_table_with_environment_context_result.read(ThriftHiveMetastore.java:39722)
at org.apache.thrift.TServiceClient.receiveBase(TServiceClient.java:78)
at
org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$Client.recv_alter_table_with_environment_context(ThriftHiveMetastore.java:1345)
at
org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$Client.alter_table_with_environment_context(ThriftHiveMetastore.java:1329)

Thanks!


On Tue, Jul 10, 2018 at 4:04 PM, Sylvester Steele <
sylvesterstee...@gmail.com> wrote:

> Hello,
>
> I am using hive-metastore jar version 1.2.1 and Hive version 2.3.2. I'd
> like to make incompatible schema changes to my Hive tables.
>
> The change I'm trying to make is to drop a column, which I am doing like
> so: table.getSd().setCols(remaining_cols). I'm dropping an int column.
> The column following it is a struct column, so my understanding is that it
> assumes I'm trying to convert an int column to a struct column.
>
> The error I get is:
>
> InvalidOperationException(message:The following columns have types
> incompatible with the existing columns in their respective positions...
>
> Doing
>
> ThriftHiveMetastore.Client client = new ThriftHiveMetastore.Client(
> protocol);
> client.get_config_value("hive.metastore.disallow.
> incompatible.col.type.changes", "default_value");
>
> gives me a true, which explains the failure earlier. How do I override
> this value to false? Also, AFAICT the default value is supposed to be
> false, so I'm not sure why this is returning true. I checked the
> hive-site.xml file and it doesn't have this set.
>
> Thanks for your help!
>
>

Reply via email to