-
Notifications
You must be signed in to change notification settings - Fork 72
table name could not be available for Kotlin dataframe JDBC #1220
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
Comments
Thanks for sharing, I suppose it’s possible, but I need some additional info:
|
@zaleslaw yes, I create a custom DB class:
DB vendor is Apache Hive, and code link is. https://github.com/apache/hive/blob/2d1405e7feed176aeed337581292b8438cf13326/jdbc/src/java/org/apache/hive/jdbc/HiveResultSetMetaData.java#L101
|
BTW, the last Apache Hive JDBC Snapshot uses empty string instead of exception thrown. public String getSchemaName(int column) throws SQLException {
String tableName = getTableName(column);
int index = tableName.lastIndexOf(DOT);
if (index >= 0) {
return tableName.substring(0, index);
}
// Impala usually doesn't return fully qualified column names. Return "" to avoid
// giving false results.
return "";
}
public String getTableName(int column) throws SQLException {
String columnName = getColumnName(column);
int index = columnName.lastIndexOf(DOT);
if (index >= 0) {
return columnName.substring(0, index);
}
return "";
} Maybe dataframe could read table name from column with val columnName = metaData.getColumnName(i)
val tableName = try {
metaData.getTableName(i)
} catch (e: Exception) {
""
// get table name from column if `.` included
}
|
From
dataframe/dataframe-jdbc/src/main/kotlin/org/jetbrains/kotlinx/dataframe/io/readJdbc.kt
Line 923 in 5f5f6a1
val tableName = metaData.getTableName(i)
could be not available for some DB vendors, such as Hive JDBC withthrow new SQLFeatureNotSupportedException("Method not supported");
It is possible to make table name empty if exception thrown.
The text was updated successfully, but these errors were encountered: