I am trying to create a Google BigQuery source in Dremio using CData’s BigQuery jdbc driver.
So far everything seems to work,
The source gets created successfully
I can see my datasets and tables from BigQuery in dremio (with their field names, etc.)
But just when I open the dataset to see the records, I encounter this error :
com.dremio.common.exceptions.UserException: IllegalArgumentException
at com.dremio.common.exceptions.UserException$Builder.build(UserException.java:802)
at com.dremio.sabot.driver.SmartOp.contextualize(SmartOp.java:140)
at com.dremio.sabot.driver.SmartOp$SmartProducer.setup(SmartOp.java:567)
at com.dremio.sabot.driver.Pipe$SetupVisitor.visitProducer(Pipe.java:79)
at com.dremio.sabot.driver.Pipe$SetupVisitor.visitProducer(Pipe.java:63)
at com.dremio.sabot.driver.SmartOp$SmartProducer.accept(SmartOp.java:533)
at com.dremio.sabot.driver.StraightPipe.setup(StraightPipe.java:102)
at com.dremio.sabot.driver.StraightPipe.setup(StraightPipe.java:102)
at com.dremio.sabot.driver.StraightPipe.setup(StraightPipe.java:102)
at com.dremio.sabot.driver.StraightPipe.setup(StraightPipe.java:102)
at com.dremio.sabot.driver.StraightPipe.setup(StraightPipe.java:102)
at com.dremio.sabot.driver.StraightPipe.setup(StraightPipe.java:102)
at com.dremio.sabot.driver.Pipeline.setup(Pipeline.java:68)
at com.dremio.sabot.exec.fragment.FragmentExecutor.setupExecution(FragmentExecutor.java:388)
at com.dremio.sabot.exec.fragment.FragmentExecutor.run(FragmentExecutor.java:270)
at com.dremio.sabot.exec.fragment.FragmentExecutor.access$1200(FragmentExecutor.java:92)
at com.dremio.sabot.exec.fragment.FragmentExecutor$AsyncTaskImpl.run(FragmentExecutor.java:674)
at com.dremio.sabot.task.AsyncTaskWrapper.run(AsyncTaskWrapper.java:104)
at com.dremio.sabot.task.slicing.SlicingThread.mainExecutionLoop(SlicingThread.java:226)
at com.dremio.sabot.task.slicing.SlicingThread.run(SlicingThread.java:156)
Caused by: java.lang.IllegalArgumentException: null
at com.google.common.base.Preconditions.checkArgument(Preconditions.java:128)
at com.dremio.exec.store.jdbc.JdbcRecordReader.checkSchemaConsistency(JdbcRecordReader.java:333)
at com.dremio.exec.store.jdbc.JdbcRecordReader.setup(JdbcRecordReader.java:213)
at com.dremio.exec.store.CoercionReader.setup(CoercionReader.java:125)
at com.dremio.sabot.op.scan.ScanOperator.setupReaderAsCorrectUser(ScanOperator.java:222)
at com.dremio.sabot.op.scan.ScanOperator.setupReader(ScanOperator.java:195)
at com.dremio.sabot.op.scan.ScanOperator.setup(ScanOperator.java:181)
at com.dremio.sabot.driver.SmartOp$SmartProducer.setup(SmartOp.java:563)
... 17 common frames omitted
Here is a link to our BigQuery connector code. It’s still very much a work in progress, but we can currently issues queries to BigQuery and get the results in Dremio.
Most of the work left is in the ARP setup, and configuring all the pushdowns. Any and all feedback is appreciated.
But, I am trying to make this work for our own internal use cases and I am still stuck here.
If I am able to solve this, it will open for us many more similar use cases, where we will create additional datasources using ARP for not just BigQuery but for other technologies too.
Since you have worked on a similar scenario, do you think this could be a problem due to my incorrect data type mappings ?
It’s possible that the CData JDBC driver returns different typenames when you execute queries than it would when you request catalog information.
In your ARP file, can you try adding data type entries where the source name is the CData type name in addition to your already existing set of BigQuery type names?
What I’m thinking is your query is returning only types that failed to map due to type name inconsistencies.
I tried setting the additional mapping where my source mapping is String (CData) and varchar(dremio), didn’t work. I am querying a table in big-query with just two columns, both of type string.
I don’t have the CData driver so I’m not sure what the problem is. From examining the stack trace I believe the driver is returning different typenames from the JDBC ResultSetMetaData object than what’s showing up in your ARP file (and also being different from the type names reported by DatabaseMetaData.getColumns()).