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

Cannot query Redshift tables with underscore in their name #24898

Open
lukaslid opened this issue Feb 4, 2025 · 0 comments
Open

Cannot query Redshift tables with underscore in their name #24898

lukaslid opened this issue Feb 4, 2025 · 0 comments

Comments

@lukaslid
Copy link

lukaslid commented Feb 4, 2025

Hello, I have strange issue when connecting to Redshift using Redshift JDBC driver.
Trino version: 433
Redshift driver: 2.1.0.31

In redshift I have two identical tables, only the name differs:

CREATE TABLE test_db.test1.employees (
    first_name VARCHAR(50)
);

CREATE TABLE test_db.test1.test_employees (
    first_name VARCHAR(50)
);

So, the issue that in Trino I can query the employees table and not test_employees . Querying test_employees results in this error: "Invalid parameter input". (Complete message in the end)
I have been debugging for a while and it do seems to be that underscores causes this issue, since these test tables are identical in types and encodings. Also, if I use system.query syntax it works fine for both tables.

Maybe some property would allow to query this table with underscores, based on what I saw in docs, it shouldn't cause any issue, since some example tables have underscores..
I also tried adding assumeLiteralUnderscoreInMetadataCallsForNonConformingClients to Trino JDBC connection, but it did not help

Complete err message:

org.jkiss.dbeaver.model.sql.DBSQLException: SQL Error [67108864]: Query failed (#...): Invalid parameter input
	at org.jkiss.dbeaver.model.impl.jdbc.exec.JDBCStatementImpl.executeStatement(JDBCStatementImpl.java:133)
	at org.jkiss.dbeaver.ui.editors.sql.execute.SQLQueryJob.executeStatement(SQLQueryJob.java:607)
	at org.jkiss.dbeaver.ui.editors.sql.execute.SQLQueryJob.lambda$1(SQLQueryJob.java:510)
	at org.jkiss.dbeaver.model.exec.DBExecUtils.tryExecuteRecover(DBExecUtils.java:190)
	at org.jkiss.dbeaver.ui.editors.sql.execute.SQLQueryJob.executeSingleQuery(SQLQueryJob.java:517)
	at org.jkiss.dbeaver.ui.editors.sql.execute.SQLQueryJob.extractData(SQLQueryJob.java:971)
	at org.jkiss.dbeaver.ui.editors.sql.SQLEditor$QueryResultsContainer.readData(SQLEditor.java:4135)
	at org.jkiss.dbeaver.ui.controls.resultset.ResultSetJobDataRead.lambda$0(ResultSetJobDataRead.java:123)
	at org.jkiss.dbeaver.model.exec.DBExecUtils.tryExecuteRecover(DBExecUtils.java:190)
	at org.jkiss.dbeaver.ui.controls.resultset.ResultSetJobDataRead.run(ResultSetJobDataRead.java:121)
	at org.jkiss.dbeaver.ui.controls.resultset.ResultSetViewer$ResultSetDataPumpJob.run(ResultSetViewer.java:5151)
	at org.jkiss.dbeaver.model.runtime.AbstractJob.run(AbstractJob.java:105)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Caused by: java.sql.SQLException: Query failed (#...): Invalid parameter input
	at io.trino.jdbc.AbstractTrinoResultSet.resultsException(AbstractTrinoResultSet.java:1937)
	at io.trino.jdbc.TrinoResultSet.getColumns(TrinoResultSet.java:318)
	at io.trino.jdbc.TrinoResultSet.create(TrinoResultSet.java:61)
	at io.trino.jdbc.TrinoStatement.internalExecute(TrinoStatement.java:262)
	at io.trino.jdbc.TrinoStatement.execute(TrinoStatement.java:240)
	at org.jkiss.dbeaver.model.impl.jdbc.exec.JDBCStatementImpl.execute(JDBCStatementImpl.java:330)
	at org.jkiss.dbeaver.model.impl.jdbc.exec.JDBCStatementImpl.executeStatement(JDBCStatementImpl.java:131)
	... 12 more
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant