soumyakanti3578 commented on code in PR #6197:
URL: https://github.com/apache/hive/pull/6197#discussion_r2663083620
##########
jdbc-handler/src/main/java/org/apache/hive/storage/jdbc/JdbcStorageHandler.java:
##########
@@ -101,12 +103,12 @@ public void configureInputJobProperties(TableDesc
tableDesc, Map<String, String>
@Override
public URI getURIForAuth(Table table) throws URISyntaxException {
Map<String, String> tableProperties =
HiveCustomStorageHandlerUtils.getTableProperties(table);
- DatabaseType dbType = DatabaseType.valueOf(
+ DatabaseType dbType = DatabaseType.from(
tableProperties.get(JdbcStorageConfig.DATABASE_TYPE.getPropertyName()));
- String host_url = DatabaseType.METASTORE == dbType ?
+ String hostUrl = DatabaseType.METASTORE == dbType ?
"jdbc:metastore://" : tableProperties.get(Constants.JDBC_URL);
- String table_name = tableProperties.get(Constants.JDBC_TABLE);
- return new URI(host_url+"/"+table_name);
+ String tableName =
unescapeHiveJdbcIdentifier(tableProperties.get(Constants.JDBC_TABLE));
Review Comment:
Yes, I checked that we do run into conflicts here. I added
```
CREATE TABLE "WorldData".Country
(
id int,
name varchar(20)
);
INSERT INTO "WorldData".Country VALUES (5, 'France'), (6, 'Italy'), (7,
'Spain'), (8, 'Portugal');
```
to `q_test_case_sensitive.postgres.sql`
While creating the external table, if we pass `"hive.sql.table" =
"country"`, the select outputs the new data shown above, but if we pass
`"hive.sql.table" = "Country"` or `"hive.sql.table" = "\"Country\""`, the
select returns data from the case sensitive table.
I think we can check if the value of `"hive.sql.table"` is escaped or not.
If not, then we can probably always just use lower case. Let me know what you
think about this.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]