Pentaho CDE parameterized queries on Impala - sql

I am trying to execute on Impala a parameterized query from Pentaho (version 5.0.6) CDE using the ${parameter_name} notation. I found out that if I remove the parameter and I hard-code the value in the SQL query, everything works fine, but if I put the parameter, everything stops working with the generic error message "Error processing component" (I am using the table component of CDE to show the values). In the pentahobaserver-stdout log file I found the following exception:
Jun 24, 2014 3:01:08 PM com.sun.jersey.spi.container.ContainerResponse mapMappableContainerException
SEVERE: The exception contained within MappableContainerException could not be mapped to a response, re-throwing to the HTTP container
java.lang.NoSuchMethodError: org.pentaho.reporting.engine.classic.core.ReportDataFactoryException.getParentThrowable()Ljava/lang/Throwable;
Which seems to be a too generic error message (caused by this bug http://jira.pentaho.com/browse/CDA-79)
After some more investigation on the web, I think I bumped into this problem. For now I cannot avoid neither the use of parameters, nor the use of Pentaho nor the use of Impala, thus, I am stuck. Is there a workaround to this problem?
Thank you in advance :)

Not really. The JDBC driver for Impala does not support parameters in PreparedStatements which is what is used in the Reporting libraries.
It's a hard one to solve. Probably the best way to workaround it is to use a Kettle transformation that dynamically builds the queries and issues them to Impala.
That way, parameter handling will be done at the Kettle level, but for Impala it will be a static query.

Related

Provider com.google.cloud.spark.bigquery.BigQueryRelationProvider could not be instantiated while writing data to bigquery using indirect method

Getting the above error while writing data to big query using spark and running it in Dataproc. Can you guys please help?
I tried with multiple version of big query spark connector but none of it seems to work. Everything throws the same error.

Hibernates' slow sql queries in Websphere Liberty

I'm deploying an EAR to Websphere Liberty 21.0.0.6 with persistence provider Hibernate 5.4 (my problem persists in version 5.5). Database is Oracle 12c.
I activated Hibernate's feature of logging slow sql queries via persistence.xml (https://docs.jboss.org/hibernate/orm/5.5/javadocs/org/hibernate/cfg/AvailableSettings.html#LOG_SLOW_QUERY)
The setting is working, but unfortunately, Liberty has a prepared statement wrapper that has no sensible toString() method. So the output in my logs is
org.hibernate.SQL_SLOW: SlowQuery: 3299 milliseconds. SQL: 'com.ibm.ws.rsadapter.jdbc.v42.WsJdbc42PreparedStatement#229da89'
org.hibernate.SQL_SLOW: SlowQuery: 2230 milliseconds. SQL: 'com.ibm.ws.rsadapter.jdbc.v42.WsJdbc42PreparedStatement#90069551'
and so on. Which doesn't help much in figuring out which queries are slow... Seems so that Hibernate just does a toString() on the prepared statement. See the source of org.hibernate.engine.jdbc.spi.SqlStatementLogger#logSlowQuery(Statement, long).
Is there a possibility to configure hibernate or liberty to output the real SQL? Do I have to implement an own statement wrapper?
Should I open a bug in hibernate?
Yes, you should open a bug against Hibernate for this. The assertion that PreparedStatement.toString will show the SQL is incorrect because there is no requirement within the JDBC specification or PreparedStatement JavaDoc that would guarantee or even recommend that behavior. The toString output that you see is pretty standard, following java.lang.Object.toString conventions of fully qualified class name # hexadecimal hash code.
WebSphere Application Server Liberty does have some options that can help you see the SQL queries and other JDBC operations. See the following section on enabling JDBC driver trace, which goes into detail depending on which database/JDBC driver you are using:
https://www.ibm.com/docs/en/was-liberty/nd?topic=liberty-enabling-jdbc-tracing
I now solved it via a custom ServiceContributor (referred to in META-INF/services/...) where I override the JdbcServicesInitiator and there, in turn, I override JdbcServicesImpl#configure to set a custom SqlStatementLogger.
In there, I use a method from the WSJdbcUtil class to refind the sql from the statement. Of course, I first need to load the class from an appropriate class loader (the one of the statement)... ugly but works.

Error in SSRS subscrition but not in Report Builber or ReportServer WebUI

So I have this report using a stored procedure which runs as expected in ReportBuilder and also on demand in the Report Server WebUI (or export as PDF).
However, when the report is generated by the subscription of the said report, it halts in error:
ERROR: Error occurred processing subscription 4ff1b786-ec4f-4d23-8cfa-a341f43ca78e: Failure writing file M04_IBM_CDS_DSTS_PledgeCollateralAndLoanItemsRecon : The Hidden expression for the tablix ‘Tablix1’ contains an error: The expression references the field 'CATEGORY', which does not exist in the Fields collection. Expressions can only refer to fields within the current dataset scope or, if inside an aggregate, the specified dataset scope. Letters in the names of fields must use the correct case.
I've tried,
Recreate the subscription
Recreate the report from scratch
Use a different version of ReportBuilder
Used various credentials for the datasource
Made sure the stored proc was actually working
I'm absolutely clueless as to what could make it fail as a subscription but not by other means. Any idea where to start to troubleshoot this issue??
I am on SQL server 2008
EDIT: im actually on SQL2014...
EDIT: It works if the subscription is generating a Word rather than a PDF... this obviously a SSRS bug
It seems the ReportServer was in an erroneous state and the issue resolved itself on it's own over the weekend.
I'm guessing one the IT automated task which restarts the server solve the issue.
No trace in any logs as to what happened really.

SQL Agent Job error when trying to run SSIS package

I have an SSIS package which when I run in VS it runs fine. I have changed the protection level to Dont Save Sensitive. I have also given any files related permission to be overwritten by the sql agent job account.
The error I am getting is:
Parsing XML with internal subset DTDs not allowed. Use CONVERT with style option 2 to enable limited internal subset DTD support.
So far I have got the impression that I need to change the code but if the code was really a problem my package wouldnt run in the first place which clearly isnt the case.
How can I reslve this?

What does "The DBMS returned an unspecified error. The command code was 193." mean?

Anyone have an idea of what this means for MS SQL Server? I'm also calling this from ColdFusion, although I'm guessing that doesn't make any difference.
Google implies that error 193 is a problem with the service. Does this happen for every query, or just one? Can you connect from SQL Management Studio?
Are you using custom JDBC driver? Try the one that comes with CF.