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] Trino, hive catalog: COMMNET COLUMN with ' ' or NULL has ArrayIndexOutOfBoundsException error #5533

Closed
danhuawang opened this issue Nov 11, 2024 · 2 comments · Fixed by #6182
Assignees
Labels
0.8.0 Release v0.8.0 bug Something isn't working

Comments

@danhuawang
Copy link
Contributor

Version

main branch

Describe what's wrong

trino:company> COMMENT ON COLUMN test_table.name IS ' ';
Query 20241111_081934_02188_de6jj failed: Index 1 out of bounds for length 1
java.lang.ArrayIndexOutOfBoundsException: Index 1 out of bounds for length 1
	at java.base/java.util.ImmutableCollections$ListN.get(ImmutableCollections.java:687)
	at org.apache.gravitino.trino.connector.catalog.CatalogConnectorMetadata.applyAlter(CatalogConnectorMetadata.java:194)
	at org.apache.gravitino.trino.connector.catalog.CatalogConnectorMetadata.setColumnComment(CatalogConnectorMetadata.java:245)
	at org.apache.gravitino.trino.connector.GravitinoMetadata.setColumnComment(GravitinoMetadata.java:317)
	at io.trino.tracing.TracingConnectorMetadata.setColumnComment(TracingConnectorMetadata.java:475)
	at io.trino.metadata.MetadataManager.setColumnComment(MetadataManager.java:882)
	at io.trino.tracing.TracingMetadata.setColumnComment(TracingMetadata.java:460)
	at io.trino.execution.CommentTask.commentOnColumn(CommentTask.java:168)
	at io.trino.execution.CommentTask.execute(CommentTask.java:80)
	at io.trino.execution.CommentTask.execute(CommentTask.java:45)
	at io.trino.execution.DataDefinitionExecution.start(DataDefinitionExecution.java:145)
	at io.trino.execution.SqlQueryManager.createQuery(SqlQueryManager.java:256)
	at io.trino.dispatcher.LocalDispatchQuery.startExecution(LocalDispatchQuery.java:145)
	at io.trino.dispatcher.LocalDispatchQuery.lambda$waitForMinimumWorkers$2(LocalDispatchQuery.java:129)
	at io.airlift.concurrent.MoreFutures.lambda$addSuccessCallback$12(MoreFutures.java:568)
	at io.airlift.concurrent.MoreFutures$3.onSuccess(MoreFutures.java:543)
	at com.google.common.util.concurrent.Futures$CallbackListener.run(Futures.java:1133)
	at io.trino.$gen.Trino_435____20241111_020150_2.run(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
	at java.base/java.lang.Thread.run(Thread.java:1583)

trino:company> COMMENT ON COLUMN test_table.name IS NULL
            -> ;
Query 20241111_082134_02199_de6jj failed: Index 1 out of bounds for length 1
java.lang.ArrayIndexOutOfBoundsException: Index 1 out of bounds for length 1
	at java.base/java.util.ImmutableCollections$ListN.get(ImmutableCollections.java:687)
	at org.apache.gravitino.trino.connector.catalog.CatalogConnectorMetadata.applyAlter(CatalogConnectorMetadata.java:194)
	at org.apache.gravitino.trino.connector.catalog.CatalogConnectorMetadata.setColumnComment(CatalogConnectorMetadata.java:245)
	at org.apache.gravitino.trino.connector.GravitinoMetadata.setColumnComment(GravitinoMetadata.java:317)
	at io.trino.tracing.TracingConnectorMetadata.setColumnComment(TracingConnectorMetadata.java:475)
	at io.trino.metadata.MetadataManager.setColumnComment(MetadataManager.java:882)
	at io.trino.tracing.TracingMetadata.setColumnComment(TracingMetadata.java:460)
	at io.trino.execution.CommentTask.commentOnColumn(CommentTask.java:168)
	at io.trino.execution.CommentTask.execute(CommentTask.java:80)
	at io.trino.execution.CommentTask.execute(CommentTask.java:45)
	at io.trino.execution.DataDefinitionExecution.start(DataDefinitionExecution.java:145)
	at io.trino.execution.SqlQueryManager.createQuery(SqlQueryManager.java:256)
	at io.trino.dispatcher.LocalDispatchQuery.startExecution(LocalDispatchQuery.java:145)
	at io.trino.dispatcher.LocalDispatchQuery.lambda$waitForMinimumWorkers$2(LocalDispatchQuery.java:129)
	at io.airlift.concurrent.MoreFutures.lambda$addSuccessCallback$12(MoreFutures.java:568)
	at io.airlift.concurrent.MoreFutures$3.onSuccess(MoreFutures.java:543)
	at com.google.common.util.concurrent.Futures$CallbackListener.run(Futures.java:1133)
	at io.trino.$gen.Trino_435____20241111_020150_2.run(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
	at java.base/java.lang.Thread.run(Thread.java:1583)

Error message and/or stacktrace

N/A

How to reproduce

  1. create table
CREATE TABLE test_table (
    id INTEGER COMMENT 'Primary identifier for the record',
    name VARCHAR COMMENT 'Name of the person',
    age INTEGER COMMENT 'Age of the person'
);

2.COMMENT ON COLUMN test_table.name IS 'a'
3. COMMENT ON COLUMN test_table.name IS ' ';
4. COMMENT ON COLUMN test_table.name IS NULL

Additional context

No response

@danhuawang danhuawang added the bug Something isn't working label Nov 11, 2024
@danhuawang
Copy link
Contributor Author

@diqiu50 Can you help check this issue?

@jerryshao jerryshao added the 0.8.0 Release v0.8.0 label Jan 10, 2025
@jerryshao
Copy link
Contributor

@diqiu50 can you please work on this?

github-actions bot pushed a commit that referenced this issue Jan 13, 2025
…undsException when execute COMMENT COLUMN command (#6182)

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

Fix the exception of ArrayIndexOutOfBoundsException when handle error
message of IllegalArgumentException

### Why are the changes needed?

Fix: #5533 

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

No

### How was this patch tested?

IT
jerryshao pushed a commit that referenced this issue Jan 13, 2025
…undsException when execute COMMENT COLUMN command (#6201)

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

Fix the exception of ArrayIndexOutOfBoundsException when handle error
message of IllegalArgumentException

### Why are the changes needed?

Fix: #5533 

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

No

### How was this patch tested?

IT

Co-authored-by: Yuhui <[email protected]>
Abyss-lord pushed a commit to Abyss-lord/gravitino that referenced this issue Jan 14, 2025
…utOfBoundsException when execute COMMENT COLUMN command (apache#6182)

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

Fix the exception of ArrayIndexOutOfBoundsException when handle error
message of IllegalArgumentException

### Why are the changes needed?

Fix: apache#5533 

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

No

### How was this patch tested?

IT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.8.0 Release v0.8.0 bug Something isn't working
Projects
None yet
2 participants