Derby "&" is not working - derby

Select distinct APP.bca_cart.InventoryCode,APP.bca_cart.InventoryID,APP.bca_cart.CartID,APP.bca_cart.InvoiceID,APP.bca_cart.UnitPrice,APP.bca_cart.DateAdded,APP.bca_cart.CustomSku,APP.bca_cart.InventoryCode & '-' & APP.bca_cart.CustomSku AS fullsku,APP.bca_cart.Qty AS O_QTY,APP.storage_clientvendor.FirstName,APP.storage_clientvendor.LastName,APP.storage_clientvendor.Name FROM ((APP.bca_iteminventory INNER JOIN (APP.bca_cart INNER JOIN APP.bca_invoice ON APP.bca_cart.InvoiceID = APP.bca_invoice.InvoiceID) ON APP.bca_iteminventory.InventoryID = APP.bca_cart.InventoryID)INNER JOIN APP.storage_clientvendor ON APP.bca_invoice.ClientVendorID =APP.storage_clientvendor.ClientVendorID) Where APP.bca_iteminventory.StoreTypeID <= 0 AND APP.bca_iteminventory.ItemTypeID NOT IN (5,4,6) AND APP.bca_iteminventory.companyId =18 ORDER BY APP. storage_clientvendor.LastName ASC
I am getting following Stacktrace. please help me to solve this error.
SEVERE: null
java.sql.SQLSyntaxErrorException: Syntax error: Encountered "&" at line 1, column 145.
at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedConnection.handleException(Unknown Source)
at org.apache.derby.impl.jdbc.ConnectionChild.handleException(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedStatement.executeQuery(Unknown Source)
at com.bzcomposer.global.tables.tblItemLoader.getBackOrderItemListByCustomer(tblItemLoader.java:8488)
at com.bzcomposer.items.ItemListPanel$BackOrderItemModel.setTableData(ItemListPanel.java:4424)
at com.bzcomposer.items.ItemListPanel$BackOrderItemModel.<init>(ItemListPanel.java:4407)
at com.bzcomposer.items.ItemListPanel.<init>(ItemListPanel.java:140)
at com.bzcomposer.modules.internalPanel.SalesPanels.<init>(SalesPanels.java:90)
at com.bzcomposer.modules.internalPanel.InternalPanelsControl.init_internalPanel1(InternalPanelsControl.java:162)
at com.bzcomposer.modules.MainFrame2.init_internalframe1(MainFrame2.java:1104)
at com.bzcomposer.modules.MainFrame2.invokeInit(MainFrame2.java:816)
at com.bzcomposer.modules.MainPanel$1.run(MainPanel.java:393)
Caused by: java.sql.SQLException: Syntax error: Encountered "&" at line 1, column 145.
at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown Source)
... 17 more
Caused by: ERROR 42X01: Syntax error: Encountered "&" at line 1, column 145.
at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
at org.apache.derby.impl.sql.compile.ParserImpl.parseStatement(Unknown Source)
i search a lot on internet but still i am not getting solution of it.

I guess you would like to concatinate the strings by using &.
For concatination you have to use ||
APP.bca_cart.InventoryCode || '-' || APP.bca_cart.CustomSku

Related

Tibco SQL Direct Query: JDBC error reported: (SQLState = ) - "This is not a valid SQL type: 2009

I am using Tibco BW 5.14 and Oracle 19c
I have Oracle table that has XMLType column. I use native oracle jdbc driver 12.1.0.2.0 for database connection.
When I run query
Select XMLTYPE_column from table
as SQL direct activity getting the error
<?xml version = "1.0" encoding = "UTF-8"?>
<ns0:ErrorReport xmlns:ns0 = "http://www.tibco.com/pe/EngineTypes">
<StackTrace>Job-7000 Error in [Processes/metrics_PROD.process/SQL Direct]
"JDBC error reported: (SQLState = ) - "This is not a valid SQL type: 2009""
at com.tibco.plugin.jdbc.JDBCActivity.eval(Unknown Source)
at com.tibco.pe.plugin.Activity.eval(Unknown Source)
at com.tibco.pe.core.TaskImpl.eval(Unknown Source)
at com.tibco.pe.core.Job.a(Unknown Source)
at com.tibco.pe.core.Job.k(Unknown Source)
at com.tibco.pe.core.JobDispatcher$JobCourier.a(Unknown Source)
at com.tibco.pe.core.JobDispatcher$JobCourier.run(Unknown Source)
caused by: "This is not a valid SQL type: 2009"
at com.tibco.plugin.jdbc.JDBCCommon.sqlTypeToSmType(Unknown Source)
at com.tibco.plugin.jdbc.JDBCCommon.sqlTypeToSmType(Unknown Source)
at com.tibco.plugin.jdbc.JDBCGeneralActivity.evalGeneralStatement(Unknown Source)
at com.tibco.plugin.jdbc.JDBCGeneralActivity.performDatabaseOperation(Unknown Source)
at com.tibco.plugin.jdbc.JDBCActivity.eval(Unknown Source)
at com.tibco.pe.plugin.Activity.eval(Unknown Source)
at com.tibco.pe.core.TaskImpl.eval(Unknown Source)
at com.tibco.pe.core.Job.a(Unknown Source)
at com.tibco.pe.core.Job.k(Unknown Source)
at com.tibco.pe.core.JobDispatcher$JobCourier.a(Unknown Source)
at com.tibco.pe.core.JobDispatcher$JobCourier.run(Unknown Source)
</StackTrace>
<Msg>"JDBC error reported: (SQLState = ) - "This is not a valid SQL type: 2009""</Msg>
<FullClass>com.tibco.plugin.jdbc.JDBCSQLException</FullClass>
<Class>JDBCSQLException</Class>
<ProcessStack>Processes/metrics_PROD.process/SQL Direct</ProcessStack>
<MsgCode>BW-JDBC-100004</MsgCode>
<Data>
<ns1:JDBCSQLException xmlns:ns1 = "http://schemas.tibco.com/bw/plugins/jdbc/5.0/jdbcExceptions">
<msg>"JDBC error reported: (SQLState = ) - "This is not a valid SQL type: 2009""</msg>
<msgCode>BW-JDBC-100004</msgCode>
<sqlState/>
<detailStr>"This is not a valid SQL type: 2009"</detailStr>
</ns1:JDBCSQLException>
</Data>
</ns0:ErrorReport>
also doesn't work with Tibco oracle driver.
<StackTrace>Job-48000 Error in [Processes/Process Definition.process/JDBC Query]
"JDBC error reported: (SQLState = HY000) - java.sql.SQLException: [tibcosoftwareinc][Oracle JDBC Driver][Oracle]ORA-22275: invalid LOB locator specified
"
at com.tibco.plugin.jdbc.JDBCActivity.eval(Unknown Source)
at com.tibco.pe.plugin.Activity.eval(Unknown Source)
at com.tibco.pe.core.TaskImpl.eval(Unknown Source)
at com.tibco.pe.core.Job.a(Unknown Source)
at com.tibco.pe.core.Job.k(Unknown Source)
at com.tibco.pe.core.JobDispatcher$JobCourier.a(Unknown Source)
at com.tibco.pe.core.JobDispatcher$JobCourier.run(Unknown Source)
caused by: java.sql.SQLException: [tibcosoftwareinc][Oracle JDBC Driver][Oracle]ORA-22275: invalid LOB locator specified
I resolved the problem using solution provided in
I am trying to extract an XMLTYPE column from an Oracle table using JDBC and having some issues
replaced query to
Select EXTRACT(XMLTYPE_column,'.').getClobVal() from table
Please note that CLOB tibco type can be used for inserting to XML_TYPE column using XMLType(?)
example
insert into EXAMPLE_TABLE (ID, XMLTYPE_COLUMN)
values (?, XMLType(?))

JPA EclipseLink - The expression is not a valid conditional expression

Although there is nothing wrong with this query, eclipselink throws this exception.
[34, 130] The expression is not a valid conditional expression.
I am trying to run Spring boot with Jpa/eclipselink in windows 7.
The problem occurs when I change system language to Turkish.
Why eclipselink doesnt work on OS that uses Turkish lang? When I change system language to English, it works fine.
Please somebody help me out.
Query:
return em.createQuery("select c from Orderdetail c where c.status=1 and c.triggertime > 0 and c.printstatus = 0 and c.idorder.idorderstatus.id in (1, 4)").setHint(QueryHints.REFRESH, HintValues.TRUE).getResultList();
This is another query parsing error. Full log
Exception Description: Syntax error parsing [select c from Orderdetail c where c.status=1 and c.triggertime > 0 and c.printstatus = 0 and c.idorder.idorderstatus.id in (1, 4)].
[34, 131] The expression is not a valid conditional expression.
at org.springframework.orm.jpa.EntityManagerFactoryUtils.convertJpaAccessExceptionIfPossible(EntityManagerFactoryUtils.java:367) ~[spring-orm-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
at org.springframework.orm.jpa.DefaultJpaDialect.translateExceptionIfPossible(DefaultJpaDialect.java:127) ~[spring-orm-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.translateExceptionIfPossible(AbstractEntityManagerFactoryBean.java:527) ~[spring-orm-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
at org.springframework.dao.support.ChainedPersistenceExceptionTranslator.translateExceptionIfPossible(ChainedPersistenceExceptionTranslator.java:61) ~[spring-tx-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
at org.springframework.dao.support.DataAccessUtils.translateIfNecessary(DataAccessUtils.java:242) ~[spring-tx-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:153) ~[spring-tx-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185) ~[spring-aop-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:688) ~[spring-aop-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
at tr.com.abeja.acservice.repository.DictionariesRepository$$EnhancerBySpringCGLIB$$9c377301.findTriggeredOrderDetails(<generated>) ~[classes!/:3.2.1]
at tr.com.abeja.acservice.service.DictsController.findAndPrintTriggeredOrderDetails(DictsController.java:887) ~[classes!/:3.2.1]
at tr.com.abeja.acservice.controller.DictsResource.updateTimerProductsPrice(DictsResource.java:48) ~[classes!/:3.2.1]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_202]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_202]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_202]
at java.lang.reflect.Method.invoke(Unknown Source) ~[na:1.8.0_202]
at org.springframework.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:84) ~[spring-context-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54) ~[spring-context-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [na:1.8.0_202]
at java.util.concurrent.FutureTask.runAndReset(Unknown Source) [na:1.8.0_202]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown Source) [na:1.8.0_202]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) [na:1.8.0_202]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [na:1.8.0_202]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [na:1.8.0_202]
at java.lang.Thread.run(Unknown Source) [na:1.8.0_202]
Caused by: java.lang.IllegalArgumentException: An exception occurred while creating a query in EntityManager:
Exception Description: Syntax error parsing [select c from Orderdetail c where c.status=1 and c.triggertime > 0 and c.printstatus = 0 and c.idorder.idorderstatus.id in (1, 4)].
[34, 131] The expression is not a valid conditional expression.
at org.eclipse.persistence.internal.jpa.EntityManagerImpl.createQuery(EntityManagerImpl.java:1746) ~[eclipselink-2.7.4.jar!/:2.7.4.v20190115-ad5b7c6b2a]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_202]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_202]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_202]
at java.lang.reflect.Method.invoke(Unknown Source) ~[na:1.8.0_202]
at org.springframework.orm.jpa.ExtendedEntityManagerCreator$ExtendedEntityManagerInvocationHandler.invoke(ExtendedEntityManagerCreator.java:350) ~[spring-orm-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
at com.sun.proxy.$Proxy68.createQuery(Unknown Source) ~[na:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_202]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_202]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_202]
at java.lang.reflect.Method.invoke(Unknown Source) ~[na:1.8.0_202]
at org.springframework.orm.jpa.SharedEntityManagerCreator$SharedEntityManagerInvocationHandler.invoke(SharedEntityManagerCreator.java:305) ~[spring-orm-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
at com.sun.proxy.$Proxy68.createQuery(Unknown Source) ~[na:na]
at tr.com.abeja.acservice.repository.DictionariesRepository.findTriggeredOrderDetails(DictionariesRepository.java:857) ~[classes!/:3.2.1]
at tr.com.abeja.acservice.repository.DictionariesRepository$$FastClassBySpringCGLIB$$5a490717.invoke(<generated>) ~[classes!/:3.2.1]
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) ~[spring-core-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:746) ~[spring-aop-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) ~[spring-aop-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:139) ~[spring-tx-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
... 18 common frames omitted
Caused by: org.eclipse.persistence.exceptions.JPQLException:
Exception Description: Syntax error parsing [select c from Orderdetail c where c.status=1 and c.triggertime > 0 and c.printstatus = 0 and c.idorder.idorderstatus.id in (1, 4)].
[34, 131] The expression is not a valid conditional expression.
at org.eclipse.persistence.internal.jpa.jpql.HermesParser.buildException(HermesParser.java:157) ~[eclipselink-2.7.4.jar!/:2.7.4.v20190115-ad5b7c6b2a]
at org.eclipse.persistence.internal.jpa.jpql.HermesParser.validate(HermesParser.java:336) ~[eclipselink-2.7.4.jar!/:2.7.4.v20190115-ad5b7c6b2a]
at org.eclipse.persistence.internal.jpa.jpql.HermesParser.populateQueryImp(HermesParser.java:280) ~[eclipselink-2.7.4.jar!/:2.7.4.v20190115-ad5b7c6b2a]
at org.eclipse.persistence.internal.jpa.jpql.HermesParser.buildQuery(HermesParser.java:165) ~[eclipselink-2.7.4.jar!/:2.7.4.v20190115-ad5b7c6b2a]
at org.eclipse.persistence.internal.jpa.EJBQueryImpl.buildEJBQLDatabaseQuery(EJBQueryImpl.java:142) ~[eclipselink-2.7.4.jar!/:2.7.4.v20190115-ad5b7c6b2a]
at org.eclipse.persistence.internal.jpa.EJBQueryImpl.buildEJBQLDatabaseQuery(EJBQueryImpl.java:118) ~[eclipselink-2.7.4.jar!/:2.7.4.v20190115-ad5b7c6b2a]
at org.eclipse.persistence.internal.jpa.EJBQueryImpl.<init>(EJBQueryImpl.java:104) ~[eclipselink-2.7.4.jar!/:2.7.4.v20190115-ad5b7c6b2a]
at org.eclipse.persistence.internal.jpa.EJBQueryImpl.<init>(EJBQueryImpl.java:88) ~[eclipselink-2.7.4.jar!/:2.7.4.v20190115-ad5b7c6b2a]
at org.eclipse.persistence.internal.jpa.EntityManagerImpl.createQuery(EntityManagerImpl.java:1744) ~[eclipselink-2.7.4.jar!/:2.7.4.v20190115-ad5b7c6b2a]
... 36 common frames omitted
[SOLVED]
After spending hours of debugging, I found the reason of this exception.
LSS: Exception was occurring in HermesParser which is query parser in eclipselink. Starting from there, i found a code that converts in, and, or, like etc parts of jpql to uppercase.
Part of my query(failing to parse).
and c.idorder.idorderstatus.id in (1, 4)
Here and and in gets converted to uppercase AND and IN. The problem is, in turkish, uppercase of i letter is İ(dotted I), so upprecase of in is İN which is incorrect expression. When Operation system language is in Turkish, uppercase method converts i to İ. That was the problem.
I changed all lowercase letters in jpql to uppercase beforehand, and solved the problem.
Hope it helps someone else ever encountered with this problem

Freemarker DOM attribute check not working

I have the following XML
<OS_LINESTATUS LINENUMBER="1" QUANTITY="6" REQUESTNUMBER="598089607" STATUSCODE="LC"/>
<OS_LINESTATUS LINENUMBER="1" QUANTITY="1" REQUESTNUMBER="725772899" STATUSCODE="LC"/>
<OS_LINESTATUS LINENUMBER="1" REQUESTNUMBER="599927622" STATUSCODE="LI"/>
I have the following freemarker template where the xml elements are injected as "elements".
[<#list elements as element>{"primeLineNo":"${element.OS_LINESTATUS.#LINENUMBER}","poLineStatusInfos":[{"poLineStatus":"${element.OS_LINESTATUS.#STATUSCODE}"<#if element.OS_LINESTATUS.#QUANTITY??>,"poLineStatusQuantity":{"measurementValue":"${element.OS_LINESTATUS.#QUANTITY}","unitOfMeasure":"EA"}</#if>}]}<#sep>,</#sep></#list>]}]}}
But this fails at the third line as there is not quantity attribute even though I have put an if condition. Why is the if condition not working?
Following is the stack trace
==> element.OS_LINESTATUS.#QUANTITY [in template "suman-xml-to-xml- orderrequestxform/xml-aggregation/linestatus.ftl" at line 4, column 331]
----
Tip: This XML query result can't be used as string because for that it had to contain exactly 1 XML node, but it contains 0 nodes. That is, the constructing XML query has found no matches.
FTL stack trace ("~" means nesting-related): - Failed at: ${element.OS_LINESTATUS.#QUANTITY} [in template "suman-xml-to- xml-orderrequestxform/xml-aggregation/linestatus.ftl" at line 4, column 329]
Java stack trace (for programmers):
freemarker.core.NonStringException: [... Exception message was already printed; see it above ...]
at freemarker.core.EvalUtil.coerceModelToString(EvalUtil.java:390)
at freemarker.core.Expression.evalAndCoerceToString(Expression.java:82)
at freemarker.core.DollarVariable.accept(DollarVariable.java:41)
at freemarker.core.Environment.visit(Environment.java:324)
at freemarker.core.MixedContent.accept(MixedContent.java:54)
at freemarker.core.Environment.visitByHiddingParent(Environment.java:345)
at freemarker.core.ConditionalBlock.accept(ConditionalBlock.java:48)
at freemarker.core.Environment.visit(Environment.java:324)
at freemarker.core.MixedContent.accept(MixedContent.java:54)
at freemarker.core.Environment.visitByHiddingParent(Environment.java:345)
at freemarker.core.IteratorBlock$IterationContext.executeNestedBlockInner(IteratorBlock.java:268)
at freemarker.core.IteratorBlock$IterationContext.executeNestedBlock(IteratorBlock.java:220)
at freemarker.core.IteratorBlock$IterationContext.accept(IteratorBlock.java:194)
at freemarker.core.Environment.visitIteratorBlock(Environment.java:572)
at freemarker.core.IteratorBlock.acceptWithResult(IteratorBlock.java:78)
at freemarker.core.IteratorBlock.accept(IteratorBlock.java:64)
at freemarker.core.Environment.visit(Environment.java:324)
at freemarker.core.MixedContent.accept(MixedContent.java:54)
at freemarker.core.Environment.visit(Environment.java:324)
at freemarker.core.Environment.process(Environment.java:302)
at freemarker.template.Template.process(Template.java:325)
at example.aggregation.XmlElementAggregator.output(XmlElementAggregator.java:93)
at example.aggregation.XmlElementAggregator.aggregate(XmlElementAggregator.java:58)
at example.aggregation.XmlElementAggregator.visitAfter(XmlElementAggregator.java:45)
at org.milyn.delivery.sax.SAXHandler.visitAfter(SAXHandler.java:389)
at org.milyn.delivery.sax.SAXHandler.endElement(SAXHandler.java:204)
at org.milyn.delivery.SmooksContentHandler.endElement(SmooksContentHandler.java:96)
at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
at org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.milyn.delivery.sax.SAXParser.parse(SAXParser.java:76)
at org.milyn.delivery.sax.SmooksSAXFilter.doFilter(SmooksSAXFilter.java:86)
at org.milyn.delivery.sax.SmooksSAXFilter.doFilter(SmooksSAXFilter.java:64)
at org.milyn.Smooks._filter(Smooks.java:526)
at org.milyn.Smooks.filterSource(Smooks.java:482)
at example.TransformerBuilder.transform(TransformerBuilder.java:66)
at example.TransformAggregation.main(TransformAggregation.java:31)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)
The #if condition works because you are asking if element.OS_LINESTATUS.#QUANTITY exists, which does, as it's a result set of size 0. Use element.OS_LINESTATUS.#QUANTITY[0]?? instead. So that's the tricky about FreeMarker's DOM wrapper, that even queries which find nothing returns something. That's why such a result is #list-able, and more importantly, can be the context of further XPath queries (like element.maybeMissingElement.child never fails, just sometimes gives an empty result set).

FAILED: RuntimeException Hive internal error: conversion of string to void not supported yet

NULL selection as column in a union/sub-queries failed with internal error
Failing HIVE query:
select clientid from hivesampletable limit 1 union all select null as clientid;
java.lang.RuntimeException: Hive internal error: conversion of string to void not supported yet.
at org.apache.hadoop.hive.serde2.objectinspector.ObjectInspectorConverters.getConverter(ObjectInspectorConverters.java:132)
at org.apache.hadoop.hive.serde2.objectinspector.ObjectInspectorConverters.getConverter(ObjectInspectorConverters.java:152)
at org.apache.hadoop.hive.ql.optimizer.ConstantPropagateProcFactory.typeCast(ConstantPropagateProcFactory.java:178)
at org.apache.hadoop.hive.ql.optimizer.ConstantPropagateProcFactory.evaluateColumn(ConstantPropagateProcFactory.java:525)
at org.apache.hadoop.hive.ql.optimizer.ConstantPropagateProcFactory.foldExprFull(ConstantPropagateProcFactory.java:328)
at org.apache.hadoop.hive.ql.optimizer.ConstantPropagateProcFactory.foldExpr(ConstantPropagateProcFactory.java:222)
at org.apache.hadoop.hive.ql.optimizer.ConstantPropagateProcFactory.foldExprFull(ConstantPropagateProcFactory.java:296)
at org.apache.hadoop.hive.ql.optimizer.ConstantPropagateProcFactory.foldExpr(ConstantPropagateProcFactory.java:222)
at org.apache.hadoop.hive.ql.optimizer.ConstantPropagateProcFactory.access$000(ConstantPropagateProcFactory.java:93)
at org.apache.hadoop.hive.ql.optimizer.ConstantPropagateProcFactory$ConstantPropagateSelectProc.process(ConstantPropagateProcFactory.java:796)
at org.apache.hadoop.hive.ql.lib.DefaultRuleDispatcher.dispatch(DefaultRuleDispatcher.java:90)
at org.apache.hadoop.hive.ql.lib.DefaultGraphWalker.dispatchAndReturn(DefaultGraphWalker.java:94)
at org.apache.hadoop.hive.ql.lib.DefaultGraphWalker.dispatch(DefaultGraphWalker.java:78)
at org.apache.hadoop.hive.ql.optimizer.ConstantPropagate$ConstantPropagateWalker.walk(ConstantPropagate.java:155)
at org.apache.hadoop.hive.ql.lib.DefaultGraphWalker.startWalking(DefaultGraphWalker.java:109)
at org.apache.hadoop.hive.ql.optimizer.ConstantPropagate.transform(ConstantPropagate.java:125)
at org.apache.hadoop.hive.ql.optimizer.Optimizer.optimize(Optimizer.java:178)
at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.analyzeInternal(SemanticAnalyzer.java:10146)
at org.apache.hadoop.hive.ql.parse.BaseSemanticAnalyzer.analyze(BaseSemanticAnalyzer.java:221)
at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:417)
at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:305)
at org.apache.hadoop.hive.ql.Driver.compileInternal(Driver.java:1069)
at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1131)
at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1006)
at org.apache.hadoop.hive.ql.Driver.run(Driver.java:996)
at org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:247)
at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:199)
at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:410)
at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:345)
at org.apache.hadoop.hive.cli.CliDriver.processReader(CliDriver.java:443)
at org.apache.hadoop.hive.cli.CliDriver.processFile(CliDriver.java:459)
at org.apache.hadoop.hive.cli.CliDriver.executeDriver(CliDriver.java:739)
at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:677)
at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:616)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.hadoop.util.RunJar.run(RunJar.java:221)
at org.apache.hadoop.util.RunJar.main(RunJar.java:136)
CAST NULL explicitly to the required type to work around it.
Ex: select cast(null as string)

Issue in Hive-0.14.0 Integration in HBase-0.98.8-hadoop2

I have hive 0.14.1 hbase 0.98.8 and hadoop 2.5.0 I am trying to integrate hive with hbase and put zookeeper-3.4.6.jar,hbase-common-0.98.8-hadoop2.jar file from HBase/lib to Hive/lib. Steps Followed are as follows:
1.hive --auxpath $HIVE_HOME/lib/hive-hbase-handler-0.14.1.jar,$HIVE_HOME/lib/hbase-common-0.98.8-hadoop2.jar,$HIVE_HOME/lib/zookeeper-3.4.6.jar,$HIVE_HOME/lib/guava-11.0.2.jar -hiveconf hbase.master=masternode:60000
2.CREATE TABLE hbase_table_1(key int, value string)
STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler'
WITH SERDEPROPERTIES ("hbase.columns.mapping" = ":key,cf1:val")
TBLPROPERTIES ("hbase.table.name" = "xyz");
This Command does not works for me.It give me error.
FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. MetaException(message:org.apache.hadoop.hbase.DoNotRetryIOException: java.lang.NoSuchMethodError: org.apache.hadoop.hbase.protobuf.generated.ClientProtos$Scan$Builder.setCaching(I)Lorg/apache/hadoop/hbase/protobuf/generated/ClientProtos$Scan$Builder;
at org.apache.hadoop.hbase.client.RpcRetryingCaller.translateException(RpcRetryingCaller.java:216)
at org.apache.hadoop.hbase.client.RpcRetryingCaller.callWithRetries(RpcRetryingCaller.java:125)
at org.apache.hadoop.hbase.client.RpcRetryingCaller.callWithRetries(RpcRetryingCaller.java:93)
at org.apache.hadoop.hbase.client.ClientScanner.nextScanner(ClientScanner.java:283)
at org.apache.hadoop.hbase.client.ClientScanner.initializeScannerInConstruction(ClientScanner.java:188)
at org.apache.hadoop.hbase.client.ClientScanner.<init>(ClientScanner.java:183)
at org.apache.hadoop.hbase.client.ClientScanner.<init>(ClientScanner.java:110)
at org.apache.hadoop.hbase.client.HTable.getScanner(HTable.java:745)
at org.apache.hadoop.hbase.catalog.MetaReader.fullScan(MetaReader.java:542)
at org.apache.hadoop.hbase.catalog.MetaReader.tableExists(MetaReader.java:310)
at org.apache.hadoop.hbase.client.HBaseAdmin.tableExists(HBaseAdmin.java:307)
at org.apache.hadoop.hbase.client.HBaseAdmin.tableExists(HBaseAdmin.java:321)
at org.apache.hadoop.hive.hbase.HBaseStorageHandler.preCreateTable(HBaseStorageHandler.java:182)
at org.apache.hadoop.hive.metastore.HiveMetaStoreClient.createTable(HiveMetaStoreClient.java:602)
at org.apache.hadoop.hive.metastore.HiveMetaStoreClient.createTable(HiveMetaStoreClient.java:595)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.invoke(RetryingMetaStoreClient.java:90)
at com.sun.proxy.$Proxy8.createTable(Unknown Source)
at org.apache.hadoop.hive.ql.metadata.Hive.createTable(Hive.java:670)
at org.apache.hadoop.hive.ql.exec.DDLTask.createTable(DDLTask.java:3959)
at org.apache.hadoop.hive.ql.exec.DDLTask.execute(DDLTask.java:295)
at org.apache.hadoop.hive.ql.exec.Task.executeTask(Task.java:160)
at org.apache.hadoop.hive.ql.exec.TaskRunner.runSequential(TaskRunner.java:85)
at org.apache.hadoop.hive.ql.Driver.launchTask(Driver.java:1604)
at org.apache.hadoop.hive.ql.Driver.execute(Driver.java:1364)
at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1177)
at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1004)
at org.apache.hadoop.hive.ql.Driver.run(Driver.java:994)
at org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:247)
at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:199)
at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:410)
at org.apache.hadoop.hive.cli.CliDriver.executeDriver(CliDriver.java:783)
at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:677)
at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:616)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.apache.hadoop.util.RunJar.main(RunJar.java:212)
Caused by: java.lang.NoSuchMethodError: org.apache.hadoop.hbase.protobuf.generated.ClientProtos$Scan$Builder.setCaching(I)Lorg/apache/hadoop/hbase/protobuf/generated/ClientProtos$Scan$Builder;
at org.apache.hadoop.hbase.protobuf.ProtobufUtil.toScan(ProtobufUtil.java:879)
at org.apache.hadoop.hbase.protobuf.RequestConverter.buildScanRequest(RequestConverter.java:488)
at org.apache.hadoop.hbase.client.ScannerCallable.openScanner(ScannerCallable.java:303)
at org.apache.hadoop.hbase.client.ScannerCallable.call(ScannerCallable.java:164)
at org.apache.hadoop.hbase.client.ScannerCallable.call(ScannerCallable.java:59)
at org.apache.hadoop.hbase.client.RpcRetryingCaller.callWithRetries(RpcRetryingCaller.java:117)
... 40 more
)
You may need to add the hbase-protocol JAR to the classpath. The symbol that could not be resolved per your stack trace appears to come from there, at least based on cursory inspection only.

Resources