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

[MINOR][SQL] Remove unused TableSchema constructor #49645

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

the-sakthi
Copy link
Member

What changes were proposed in this pull request?

This PR removes the unused TableSchema(int numColumns) constructor, which was previously marked with a TODO comment for removal.

Why are the changes needed?

The constructor is no longer required and does not serve any functional purpose in the codebase. Eliminating this dead code enhances code maintainability and readability.

Does this PR introduce any user-facing change?

No

How was this patch tested?

Existing tests and moreover we don't use this constructor anywhere in the codebase:

❯ git grep "new TableSchema"
sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/operation/GetCatalogsOperation.java:  private static final TableSchema RESULT_SET_SCHEMA = new TableSchema()
sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/operation/GetColumnsOperation.java:  protected static final TableSchema RESULT_SET_SCHEMA = new TableSchema()
sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/operation/GetColumnsOperation.java:          TableSchema schema = new TableSchema(metastoreClient.getSchema(dbName,
sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/operation/GetCrossReferenceOperation.java:  private static final TableSchema RESULT_SET_SCHEMA = new TableSchema()
sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/operation/GetFunctionsOperation.java:  private static final TableSchema RESULT_SET_SCHEMA = new TableSchema()
sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/operation/GetPrimaryKeysOperation.java:  private static final TableSchema RESULT_SET_SCHEMA = new TableSchema()
sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/operation/GetSchemasOperation.java:  private static final TableSchema RESULT_SET_SCHEMA = new TableSchema()
sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/operation/GetTableTypesOperation.java:  protected static TableSchema RESULT_SET_SCHEMA = new TableSchema()
sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/operation/GetTablesOperation.java:  private static final TableSchema RESULT_SET_SCHEMA = new TableSchema()
sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/operation/GetTypeInfoOperation.java:  private static final TableSchema RESULT_SET_SCHEMA = new TableSchema()
sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/operation/OperationManager.java:    TableSchema tableSchema = new TableSchema(getLogSchema());

Was this patch authored or co-authored using generative AI tooling?

No

@github-actions github-actions bot added the SQL label Jan 24, 2025
@the-sakthi the-sakthi marked this pull request as ready for review January 24, 2025 08:11
Copy link
Contributor

@LuciferYang LuciferYang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This part of the code originates from Hive. Please do not modify it unless absolutely necessary. However, if there is a corresponding patch in Hive to remove it, may port it over and provide supplementary descriptions in the pull request (PR).

@the-sakthi
Copy link
Member Author

Thanks for the review @LuciferYang ! Will check and do the needful.

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

Successfully merging this pull request may close these issues.

2 participants