[
https://issues.apache.org/jira/browse/DRILL-2836?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14545837#comment-14545837
]
Daniel Barclay (Drill) commented on DRILL-2836:
-----------------------------------------------
We've recently added, as an internal (unsupported) diagnostic feature, a proxy
JDBC driver that traces calls made through it to another JDBC driver.
Using it should show the query that SquirreL is issuing and that is yielding
that no-such-column error (or show which call to a JDBC-API method is
internally yielding the query that yields that error).
To use the tracing proxy:
- reconfigure the JDBC client (e.g., Squirrel) to use a driver class of
{{org.apache.drill.jbdbc.proxy.TracingProxyDriver}},
- use a connection URL that consists of
"{{jdbc:proxy:org.apache.drill.jdbc.Driver:}}" prepended to the original URL
(e.g., "{{jdbc:drill:zk=local}}"),
- open a connection to that URL,
- use that connection (e.g., perform whatever steps let to the no-such-column
error), and
- look wherever stderr (the standard error output stream; Java's
{{System.err}}) is configured to be sent (e.g., your terminal, a SquirreL, log
file, etc.). (There should be lots of lines about JDBC method calls and
returns.)
Daniel
> "SQLException: column 'TABLE_CATALOG' not found" when trying to connect with
> JDBC clients
> -----------------------------------------------------------------------------------------
>
> Key: DRILL-2836
> URL: https://issues.apache.org/jira/browse/DRILL-2836
> Project: Apache Drill
> Issue Type: Bug
> Components: Client - JDBC
> Affects Versions: 0.9.0
> Environment: Ubuntu 14.04 64 bits. Java "1.7.0_75". Latest SquirreL
> FX. Latest Netbeans
> Reporter: Mariano Ruiz
> Assignee: Daniel Barclay (Drill)
> Priority: Minor
> Fix For: 1.2.0
>
>
> I'm trying with latest build from Git repo, commit
> {{#be8d953935461ee6567b0c4d96c503e8b04469d2}}, I run a single node correctly
> with {{drillbit.sh}} and login with {{sqline}} through "Zookeeper" without
> problems.
> Also I developed a small Java main app and I was able to consume a MongoDB
> database with basics SQL queries without problem.
> But when I try to explore the databases from an advance SQL client like
> "SquirreL" (following the steps in the official
> [guide|https://cwiki.apache.org/confluence/display/DRILL/Using+JDBC+to+Access+Apache+Drill+from+SQuirreL]),
> or with the Netbeans Database Explorer, I cant connect with Apache Drill.
> In SQuirreL, I get this:
> {code}
> java.sql.SQLException: column 'TABLE_CATALOG' not found
> Message: java.sql.SQLException: column 'TABLE_CATALOG' not found
> java.lang.RuntimeException: java.sql.SQLException: column 'TABLE_CATALOG' not
> found
> at
> org.squirrelsql.services.sqlwrap.SQLConnection.getSchemas(SQLConnection.java:139)
> at
> org.squirrelsql.session.schemainfo.SchemaCacheFactory.appendSchemas(SchemaCacheFactory.java:159)
> at
> org.squirrelsql.session.schemainfo.SchemaCacheFactory.appendChildren(SchemaCacheFactory.java:76)
> at
> org.squirrelsql.session.schemainfo.SchemaCacheFactory.recursiveAppendChildren(SchemaCacheFactory.java:31)
> at
> org.squirrelsql.session.schemainfo.SchemaCacheFactory.recursiveAppendChildren(SchemaCacheFactory.java:35)
> at
> org.squirrelsql.session.schemainfo.SchemaCacheFactory.createDatabaseStructure(SchemaCacheFactory.java:23)
> at
> org.squirrelsql.session.schemainfo.SchemaCacheFactory.createSchemaCache(SchemaCacheFactory.java:16)
> at
> org.squirrelsql.aliases.dbconnector.DBConnector.doTryConnect(DBConnector.java:150)
> at
> org.squirrelsql.aliases.dbconnector.DBConnector.access$000(DBConnector.java:21)
> at
> org.squirrelsql.aliases.dbconnector.DBConnector$1.call(DBConnector.java:81)
> at
> org.squirrelsql.aliases.dbconnector.DBConnector$1.call(DBConnector.java:77)
> at
> org.squirrelsql.services.progress.ProgressUtil$1.call(ProgressUtil.java:26)
> at javafx.concurrent.Task$TaskCallable.call(Task.java:1423)
> at java.util.concurrent.FutureTask.run(FutureTask.java:266)
> at javafx.concurrent.Service.lambda$null$488(Service.java:725)
> at javafx.concurrent.Service$$Lambda$480/738924402.run(Unknown Source)
> at java.security.AccessController.doPrivileged(Native Method)
> at javafx.concurrent.Service.lambda$executeTask$489(Service.java:724)
> at javafx.concurrent.Service$$Lambda$478/1701182789.run(Unknown Source)
> at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
> at java.lang.Thread.run(Thread.java:745)
> Caused by: java.sql.SQLException: column 'TABLE_CATALOG' not found
> at
> net.hydromatic.avatica.AvaticaResultSet.findColumn0(AvaticaResultSet.java:76)
> at
> net.hydromatic.avatica.AvaticaResultSet.getAccessor(AvaticaResultSet.java:102)
> at
> net.hydromatic.avatica.AvaticaResultSet.getString(AvaticaResultSet.java:270)
> at
> org.squirrelsql.services.sqlwrap.SQLConnection.getSchemas(SQLConnection.java:101)
> ... 21 more
> {code}
> I don't care if I cannot explore the databases schemas, I'm aware that Apache
> Drill is an agnostic tool, I just wan't to access to the database from these
> tools to do some queries with a visual interface with a nice scrollable
> resultset, and due this error I cannot make queries with these tools or any
> other database explorer through JDBC.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)