apache drill - AssertionError: Relational expression - mysql

running apache-drill-1.14.0
tested this query on mysql and got result in 0.02 sec
running the query in drill cli fails with AssertionError
Query:
product_id is BIGINT
SELECT test50.customername, test50.color, test50.age, test50.city,
test50.product_id, test50.price FROM myplugin.sampler.test50 JOIN
myplugin.sampler.test52 ON test50.product_id = test52.product_id WHERE
test50.product_id = 759216 GROUP BY test50.customername, test50.color,
test50.age, test50.city, test50.product_id, test50.price ORDER BY
test50.customername;
Error:
Error: SYSTEM ERROR: AssertionError: Relational expression
rel#873:DrillFilterRel.JDBC.myplugin.ANY([]).
[](input=rel#83:JdbcTableScan.JDBC.myplugin.ANY([]).[](table=[myplugin,
sampler, test50]),condition=OR(=($18, 759216), =($18, 494636))) has
calling-convention JDBC.myplugin but does not implement the required interface
'interface org.apache.calcite.adapter.jdbc.JdbcRel' of that convention
need help if I need some extra configuration ?
Thanks

Could you please check on current master? Looks like it was fixed in DRILL-6850.

Related

SQLAlchemy - Unable to reflect SQL view

I'm getting the following error message when trying to reflect any of my SQL views:
sqlalchemy/dialects/mysql/reflection.py", line 306, in _describe_to_create
buffer.append(" ".join(line))
TypeError: sequence item 2: expected str instance, bytes found
I have tried using both the autoload_with and autoload=True options in my select query constructor to no avail.
I have the appropriate permissions on my view. My query is pretty simple:
company_country = Table('company_country', metadata, autoload_with=engine)
query = select(company_country.c.country)
return query
I've tried the inspect utility and it does not list my SQL view, nor does the reflecting all tables described below the views section on this page: https://docs.sqlalchemy.org/en/14/core/reflection.html#reflecting-views
I'm using version SQLAlchemy->1.4.32, Python 3.x and mySQL 8.0.28 on Mac if that's any help
I should add that I can query my SQL views using the text() constructor but it would be far more preferable to use select() if possible.
Any tips appreciated
I was using the mysql-connector client for interop with other code, but after switching to the mysqlclient, I was able to reflect the views.
https://docs.sqlalchemy.org/en/14/dialects/mysql.html#module-sqlalchemy.dialects.mysql.mysqldb

Progress SQL error in ssis package: buffer too small for generated record

I have an ssis package which uses SQL command to get data from Progress database. Every time I execute the query, it throws this specific error:
ERROR [HY000] [DataDirect][ODBC Progress OpenEdge Wire Protocol driver][OPENEDGE]Internal error -1 (buffer too small for generated record) in SQL from subsystem RECORD SERVICES function recPutLONG called from sts_srtt_t:::add_row on (ttbl# 4, len/maxlen/reqlen = 33/32/33) for . Save log for Progress technical support.
I am running the following query:
Select max(ROWID) as maxRowID from TableA
GROUP BY ColumnA,ColumnB,ColumnC,ColumnD
I've had the same error.
After change startup-parameter -SQLTempStorePageSize and -SQLTempStoreBuff to 24 and 3000 respectively the problem was solved.
I think, for you the values must be changed to 40 and 20000.
You can find more information here. The name of the parameter in that article was a bit different than in my Database, it depends on the Progress-version witch is used.

How to get the exact query generated by the ODBC driver

We are connecting Hadoop cloudera CDH distribution through ODBC driver. Queries are generated from SSRS. Few queries are working fine with parameters augmented through ? placeholder. Few other queries with parameters augmented through ? are not executing.
Error [HY000][Cloudera][ImpalaODBC] (100) error while executing a query in Impala[HY000] : AnalysisException : syntax error in line 1 where Date >= ? and Date <= ?
^Encountered : Unexpected characterExpected : Case... Exception : syntax error.
If i remove where Date >= ? and Date <= ? or supply the hard coded value then query is working perfect.
Few other queries with same filter are working perfect.
What should be recommended investigation points?
Where could i get the exact impala transformed query to investigate whether query is generated correct or not ?
You have a couple of options:
/var/log/impalad/audit stores audit logs (at least in CDH). Those logs contain sql_statement field that stores executed sql queries
Impala has a web server running on a 25000 port. You could connect
with your browser and see queries executed (/queries tab).
If you are using Cloudera Manager, you could see all executed impala
queries in "impala/queries"

SSIS (2008R2) import from mssql to mysql failing due to a date column

I have an oledb connection to mssql and an ado.net destination (with odbc driver used) to mysql. The tables are exectly the same and all the columns are working bar one.
The error message received is:
[ADO NET Destination [325]] Error: An exception has occurred during data insertion, the message returned from the provider is: Unable to cast object of type 'System.DateTime' to type 'System.Char[]'.
I've seen similar questions on other data types but the resolution of changing to string does not work here. If I convert to string (has to be length 29 otherwise the conversion step fails) I get the following error message:
[ADO NET Destination [325]] Error: An exception has occurred during data insertion, the message returned from the provider is: ERROR [HY000] [MySQL][ODBC 5.1 Driver][mysqld-5.5.15]Incorrect datetime value: '2011-03-21 11:23:48.573000000' for column 'LastModificationDate' at row 1
Other potentially relevant details:
connection driver- {MySQL ODBC 5.1 Driver}
script run before dataflow - set sql_mode='STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION,ANSI_QUOTES'
Other datetime columns are working
This column has a reasonably high proportion of nulls
mssql spec: [LastModificationDate] [datetime] NULL
mysql spec: LastModificationDate datetime NULL
Has anyone had experience with this issue and could provide some advice on resolving it?
Can you try converting it to string on sql server side in your query using:
convert(char(10),LastModificationDate,111)+' '+convert(char(8),LastModificationDate,108)
This works for me all the time.
I got the same big headache this week. I tried many ways. Thanks God, finnally, one of them worked. Hope it could help you a little bit.
For some columns with the data type of Int, datetime, decimal....,here, I identified as ColumnA, and I used it as datetime type.
1.in Data Flow Source, use SQL Command to retrieve data. Sth like select isnull(ColumnA,'1800-01-01') as ColumnA, C1, C2, ... Cn from Table
Make sure to use Isnull function for all columns with the datatype mentioned before.
2.Excute the SSIS pkg. It should work.
3.Go back to Control Flow, under the data flow task, add SQL Task control to replace the data back. I mean, update the ColumnA from '1800-01-01' to null again.
That works for me. In my situation, I cannot use ignore failure option. Because if I do, I will lose thousands rows of data.

SQL Exception: Unknown column in where clause

I am using Hibernate3 with spring application.
I introduced a column in my existing table with many to one relationship with the addition in the .hbm file as mentioned below:
<many-to-one name="qualityStatus" column="quality_status"
class="model.PurchaseStatus" lazy="false" fetch="join"/>
The corresponding object to this hbm has a property of type 'PurchaseStatus' and field name as 'qualityStatus'.
Now when i try fetching the data from the table representing the above object with the query:
List<Long> dnIds = session.createQuery("select dnItem.dnId from DeliveryNoteItem dnItem where dnItem.qualityStatus!=? and dnItem.qualityStatus!=? and dnItem.qualityStatus!=?")
.setInteger(0,1)
.setInteger(1,5)
.setInteger(2,7)
.list();
i get an error saying as 'java.sql.Exception: Unknown column 'deliveryno0_.quality_status' in 'where clause'
I get this error when deployed on test server but when i check the same thing on my local server i works fine as well when i just run this query directly on the database on the test server it returns me result. So it confirms that the database on the test server is alright. It is only when it executes through the application on the test server i am getting this error.
Can anybody let me know what can be the reason or how do i debug this out.
Thanks in advance. Looking forward for replies.
If you really have a quality_status column in your database, then you should make sure you have the most recent version of your application deployed on the test server, and make sure that the connection url of hibernate really points to the test database.
This is not a hibernate problem, not a programming one. It is environmental - check your configurations and redeploy.