Riza Suminto has posted comments on this change. ( http://gerrit.cloudera.org:8080/22865 )
Change subject: IMPALA-13869: Support for 'hive.sql.query' property for Hive JDBC tables ...................................................................... Patch Set 7: (3 comments) http://gerrit.cloudera.org:8080/#/c/22865/7/fe/src/main/java/org/apache/impala/catalog/TableLoader.java File fe/src/main/java/org/apache/impala/catalog/TableLoader.java: http://gerrit.cloudera.org:8080/#/c/22865/7/fe/src/main/java/org/apache/impala/catalog/TableLoader.java@232 PS7, Line 232: String table = msTbl.getParameters().get("hive.sql.table"); : String query = msTbl.getParameters().get("hive.sql.query"); : : if (Strings.isNullOrEmpty(table) && Strings.isNullOrEmpty(query)) { : throw new TableLoadingException("Either 'hive.sql.table' or" + : " 'hive.sql.query' must be set."); : } : : if (table != null) { : impala_tbl_props.put("table", table); : } : if (query != null) { : impala_tbl_props.put("query", query); : } Please check for all possibilities. if (Strings.isNullOrEmpty(table) && Strings.isNullOrEmpty(query)) { ... } else if (table != null && query != null) { ... } else if (table != null) { impala_tbl_props.put("table", table); } else { impala_tbl_props.put("query", query); } Please add negative test where both "hive.sql.table" and "hive.sql.query" is set. http://gerrit.cloudera.org:8080/#/c/22865/7/fe/src/main/java/org/apache/impala/extdatasource/jdbc/JdbcDataSource.java File fe/src/main/java/org/apache/impala/extdatasource/jdbc/JdbcDataSource.java: http://gerrit.cloudera.org:8080/#/c/22865/7/fe/src/main/java/org/apache/impala/extdatasource/jdbc/JdbcDataSource.java@325 PS7, Line 325: // Make jdbc table name to be quoted with double quotes if columnMapping is not empty : if (!columnMapping.isEmpty()) { : tableName = dbAccessor_.getCaseSensitiveName(tableName); : } : sb.append(tableName); : String condition = QueryConditionUtil : .buildCondition(params.getPredicates(), columnMapping, dbAccessor_); : if (StringUtils.isNotBlank(condition)) { : sb.append(" WHERE ").append(condition); : } : : query = sb.toString(); Indentation still off here. Need two more spaces. Try use clang-format to auto format the code. https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=65147115#ContributingtoImpala-Fix http://gerrit.cloudera.org:8080/#/c/22865/7/tests/custom_cluster/test_ext_data_sources.py File tests/custom_cluster/test_ext_data_sources.py: http://gerrit.cloudera.org:8080/#/c/22865/7/tests/custom_cluster/test_ext_data_sources.py@543 PS7, Line 543: assert "SET MAX_ERRORS=10000" in response_json, \ : "No matching option MAX_ERRORS found in the queries site." : assert "SET MEM_LIMIT=1000000000" in response_json, \ : "No matching option MEM_LIMIT found in the queries site." : assert "SET ENABLED_RUNTIME_FILTER_TYPES=\\\"BLOOM,MIN_MAX\\\"" in response_json or \ : "SET ENABLED_RUNTIME_FILTER_TYPES='BLOOM,MIN_MAX'" in response_json, \ : "No matching option ENABLED_RUNTIME_FILTER_TYPES found in the queries site." : assert "SET QUERY_TIMEOUT_S=600" in response_json, \ : "No matching option QUERY_TIMEOUT_S found in the queries site." : assert "SET REQUEST_POOL=\\\"default-pool\\\"" in response_json, \ : "No matching option REQUEST_POOL found in the queries site." : assert "SET DEBUG_ACTION" not in response_json, \ : "Matching option DEBUG_ACTION found in the queries site." Unnecessary changes? -- To view, visit http://gerrit.cloudera.org:8080/22865 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I039fcc1e008233a3eeed8d09554195fdb8c8706b Gerrit-Change-Number: 22865 Gerrit-PatchSet: 7 Gerrit-Owner: Pranav Lodha <[email protected]> Gerrit-Reviewer: Impala Public Jenkins <[email protected]> Gerrit-Reviewer: Pranav Lodha <[email protected]> Gerrit-Reviewer: Riza Suminto <[email protected]> Gerrit-Reviewer: Wenzhe Zhou <[email protected]> Gerrit-Comment-Date: Tue, 17 Jun 2025 23:17:12 +0000 Gerrit-HasComments: Yes
