Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug report] createTable HiveTable failed if comment is null #1544

Closed
FANNG1 opened this issue Jan 17, 2024 · 1 comment · Fixed by #1553
Closed

[Bug report] createTable HiveTable failed if comment is null #1544

FANNG1 opened this issue Jan 17, 2024 · 1 comment · Fixed by #1553
Assignees

Comments

@FANNG1
Copy link
Contributor

FANNG1 commented Jan 17, 2024

Describe what's wrong

createTable HiveTable failed if comment is null

Error message and/or stacktrace

Caused by: java.lang.NullPointerException
	at org.apache.thrift.protocol.TBinaryProtocol.writeString(TBinaryProtocol.java:206)
	at org.apache.hadoop.hive.metastore.api.Table$TableStandardScheme.write(Table.java:1695)
	at org.apache.hadoop.hive.metastore.api.Table$TableStandardScheme.write(Table.java:1477)
	at org.apache.hadoop.hive.metastore.api.Table.write(Table.java:1325)
	at org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$create_table_with_environment_context_args$create_table_with_environment_context_argsStandardScheme.write(ThriftHiveMetastore.java:41610)
	at org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$create_table_with_environment_context_args$create_table_with_environment_context_argsStandardScheme.write(ThriftHiveMetastore.java:41565)
	at org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$create_table_with_environment_context_args.write(ThriftHiveMetastore.java:41505)
	at org.apache.thrift.TServiceClient.sendBase(TServiceClient.java:71)
	at org.apache.thrift.TServiceClient.sendBase(TServiceClient.java:62)
	at org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$Client.send_create_table_with_environment_context(ThriftHiveMetastore.java:1197)
	at org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$Client.create_table_with_environment_context(ThriftHiveMetastore.java:1188)
	at org.apache.hadoop.hive.metastore.HiveMetaStoreClient.create_table_with_environment_context(HiveMetaStoreClient.java:2396)
	at org.apache.hadoop.hive.metastore.HiveMetaStoreClient.createTable(HiveMetaStoreClient.java:750)
	at org.apache.hadoop.hive.metastore.HiveMetaStoreClient.createTable(HiveMetaStoreClient.java:738)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.invoke(RetryingMetaStoreClient.java:169)
	at com.sun.proxy.$Proxy107.createTable(Unknown Source)
	at com.datastrato.gravitino.catalog.hive.HiveCatalogOperations.lambda$createTable$20(HiveCatalogOperations.java:596)
	at com.datastrato.gravitino.utils.ClientPoolImpl.run(ClientPoolImpl.java:59)
	at com.datastrato.gravitino.utils.ClientPoolImpl.run(ClientPoolImpl.java:52)
	at com.datastrato.gravitino.catalog.hive.HiveCatalogOperations.createTable(HiveCatalogOperations.java:594)

How to reproduce

  1. set TASBLE_COMMENT = null
  2. run CatalogHiveIT#testCreateHiveTable

Additional context

No response

@FANNG1
Copy link
Contributor Author

FANNG1 commented Jan 17, 2024

I prefer to add a default value to comment, is null, set to a empty string. try to remove null handle logic in catalogs.

jerryshao pushed a commit that referenced this issue Jan 18, 2024
### What changes were proposed in this pull request?

set empty string as default value of comment when creating table

### Why are the changes needed?

Fix: #1544 

### Does this PR introduce _any_ user-facing change?
no

### How was this patch tested?

IT added
mchades added a commit to mchades/gravitino that referenced this issue Jan 24, 2024
…che#1553)

### What changes were proposed in this pull request?

set empty string as default value of comment when creating table

### Why are the changes needed?

Fix: apache#1544 

### Does this PR introduce _any_ user-facing change?
no

### How was this patch tested?

IT added
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants