Skip to content

Conversation

vikramahuja1001
Copy link
Contributor

What changes were proposed in this pull request?

Why are the changes needed?

Does this PR introduce any user-facing change?

How was this patch tested?

@vikramahuja1001
Copy link
Contributor Author

@deniskuzZ , @chinnaraolalam could you please take a look at this PR?

@@ -53,17 +56,29 @@ public void analyzeInternal(ASTNode root) throws SemanticException {
String tableNames = null;
TableType tableTypeFilter = null;
boolean isExtended = false;
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: better to use isIceberg, to have uniform variable naming as above line isExtended

if (type != null) {
throw new HiveException("Iceberg Tables by default is External Table");
} else {
if (pattern != null) {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: This looks cleaner.

if (ifIceberg) {
        if (type != null) {
          throw new HiveException("Iceberg tables are always of type EXTERNAL_TABLE");
        }
        String icebergPattern = (pattern != null) ? pattern : ".*";
        List<TableName> icebergTables = getIcebergTables(getMSC(), null, dbName, icebergPattern).getTables();
        return icebergTables.stream()
          .map(TableName::getTable)
          .collect(Collectors.toList());
      }

@Aggarwal-Raghav
Copy link
Contributor

Just thinking out loud: As the idea is to only do this for iceberg tables! Is it feasible to do something like this?
show iceberg tables; instead of show tables where `format`='iceberg'

@vikramahuja1001
Copy link
Contributor Author

vikramahuja1001 commented Aug 11, 2025

Just thinking out loud: As the idea is to only do this for iceberg tables! Is it feasible to do something like this? show iceberg tables; instead of show tables where `format`='iceberg'

Yes, it can be done. But to do this, Iceberg has to be exposed as a keyword in Hive which it is not atm. That would require changes in the alter and stored_by grammar as well. I purposely kept it this way to not make any changes on those layers. But yeah, i can make thee changes if there is a consensus here.

Copy link

@@ -1974,6 +1996,15 @@ public List<String> getTablesByType(String dbName, String pattern, TableType typ

try {
List<String> result;
if (isIceberg) {
if (type != null) {
throw new HiveException("Iceberg Tables by default is External Table");
Copy link
Contributor

Choose a reason for hiding this comment

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

should this be an exception in this case?

  1. can we show it like below?
# Table Name        	Table Type          
test_iceberg      	EXTERNAL_TYPE  
  1. Or you could handle it in analyse step itself -- In ShowTablesAnalyzer

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

Successfully merging this pull request may close these issues.

4 participants