[JBoss JIRA] (TEIID-5368) JSONTOXML fails on parsing too long numbers
by dalex dalex (JIRA)
[ https://issues.jboss.org/browse/TEIID-5368?page=com.atlassian.jira.plugin... ]
dalex dalex updated TEIID-5368:
-------------------------------
Description:
Running the following query:
{code:noformat}
select jsontoxml('root','{
"items" : [{
"ordernumber" : "NL0000026010",
"orderdate" : "2016-01-01T01:13:39Z",
"orderdate_ts" : "01-01-2016 01:13:39",
"totalprice" : 24.8,
"total_order_price" : 24.8,
"vatvalue" : 4.3,
"vatrate" : 21,
"vatcustomernumber" : null,
"odr_description" : null,
"odr_note" : null,
"rest_status" : "pending",
"shipping_minimum_date" : null,
"shipping_maximum_date" : null,
"order_source" : "Magento",
"oss_id" : 131458290409912116350633678684356778292}, {
"ordernumber" : "NL0000026011",
"orderdate" : "2016-01-01T06:52:05Z",
"orderdate_ts" : "01-01-2016 06:52:05",
"totalprice" : 27.85,
"total_order_price" : 27.85,
"vatvalue" : 4.84,
"vatrate" : 21,
"vatcustomernumber" : null,
"odr_description" : null,
"odr_note" : null,
"rest_status" : "pending",
"shipping_minimum_date" : null,
"shipping_maximum_date" : null,
"order_source" : "Magento",
"oss_id" : 131458290409912116350633678684356778292
}
],
"hasMore" : true,
"limit" : 10,
"offset" : 0,
"count" : 10
}') ;;
{code}
fails with the following error message:
{code:noformat}
15:30:44,531 WARN [org.teiid.PROCESSOR] (Worker0_QueryProcessorQueue5) p69Z3QNLg3hP TEIID30020 Processing exception for request p69Z3QNLg3hP.0 'TEIID30328 Unable to evaluate jsontoxml('root', ?): TEIID30384 Error while evaluating function jsontoxml'. Originally ExpressionEvaluationException 'For input string: "131458290409912116350633678684356778292"' NumberFormatException.java:65.: org.teiid.api.exception.query.ExpressionEvaluationException: TEIID30328 Unable to evaluate jsontoxml('root', ?): TEIID30384 Error while evaluating function jsontoxml
at org.teiid.query.eval.Evaluator.evaluate(Evaluator.java:709)
at org.teiid.query.rewriter.QueryRewriter.evaluate(QueryRewriter.java:2295)
at org.teiid.query.rewriter.QueryRewriter.rewriteExpressionDirect(QueryRewriter.java:2285)
at org.teiid.query.rewriter.QueryRewriter.access$000(QueryRewriter.java:105)
at org.teiid.query.rewriter.QueryRewriter$2.replaceExpression(QueryRewriter.java:767)
at org.teiid.query.sql.visitor.ExpressionMappingVisitor.visit(ExpressionMappingVisitor.java:158)
at org.teiid.query.sql.symbol.ExpressionSymbol.acceptVisitor(ExpressionSymbol.java:59)
at org.teiid.query.sql.navigator.AbstractNavigator.visitVisitor(AbstractNavigator.java:50)
at org.teiid.query.sql.navigator.PreOrPostOrderNavigator.postVisitVisitor(PreOrPostOrderNavigator.java:57)
at org.teiid.query.sql.navigator.PreOrPostOrderNavigator.visit(PreOrPostOrderNavigator.java:179)
at org.teiid.query.sql.symbol.ExpressionSymbol.acceptVisitor(ExpressionSymbol.java:59)
at org.teiid.query.sql.navigator.AbstractNavigator.visitNode(AbstractNavigator.java:59)
at org.teiid.query.sql.navigator.AbstractNavigator.visitNodes(AbstractNavigator.java:72)
at org.teiid.query.sql.navigator.PreOrPostOrderNavigator.visit(PreOrPostOrderNavigator.java:338)
at org.teiid.query.sql.lang.Select.acceptVisitor(Select.java:164)
at org.teiid.query.sql.navigator.PostOrderNavigator.doVisit(PostOrderNavigator.java:36)
at org.teiid.query.rewriter.QueryRewriter.rewriteExpressions(QueryRewriter.java:774)
at org.teiid.query.rewriter.QueryRewriter.rewriteQuery(QueryRewriter.java:559)
at org.teiid.query.rewriter.QueryRewriter.rewriteCommand(QueryRewriter.java:269)
at org.teiid.query.rewriter.QueryRewriter.rewrite(QueryRewriter.java:172)
at org.teiid.query.rewriter.QueryRewriter.rewrite(QueryRewriter.java:176)
at org.teiid.dqp.internal.process.Request.generatePlan(Request.java:436)
at org.teiid.dqp.internal.process.Request.processRequest(Request.java:486)
at org.teiid.dqp.internal.process.RequestWorkItem.processNew(RequestWorkItem.java:660)
at org.teiid.dqp.internal.process.RequestWorkItem.process(RequestWorkItem.java:339)
at org.teiid.dqp.internal.process.AbstractWorkItem.run(AbstractWorkItem.java:47)
at org.teiid.dqp.internal.process.RequestWorkItem.run(RequestWorkItem.java:276)
at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:277)
at org.teiid.dqp.internal.process.ThreadReuseExecutor$RunnableWrapper.run(ThreadReuseExecutor.java:115)
at org.teiid.dqp.internal.process.ThreadReuseExecutor$3.run(ThreadReuseExecutor.java:206)
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: org.teiid.api.exception.query.FunctionExecutionException: TEIID30384 Error while evaluating function jsontoxml
at org.teiid.query.function.FunctionDescriptor.invokeFunction(FunctionDescriptor.java:289)
at org.teiid.query.eval.Evaluator.evaluate(Evaluator.java:1309)
at org.teiid.query.eval.Evaluator.internalEvaluate(Evaluator.java:741)
at org.teiid.query.eval.Evaluator.evaluate(Evaluator.java:707)
... 32 more
Caused by: java.lang.NumberFormatException: For input string: "131458290409912116350633678684356778292"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.lang.Long.parseLong(Long.java:592)
at java.lang.Long.valueOf(Long.java:803)
at org.teiid.json.simple.Yylex.yylex(Yylex.java:662)
at org.teiid.json.simple.JSONParser.nextToken(JSONParser.java:125)
at org.teiid.json.simple.JSONParser.parse(JSONParser.java:257)
at org.teiid.query.function.source.XMLSystemFunctions$JsonToXmlContentHandler.nextEvent(XMLSystemFunctions.java:354)
at org.codehaus.stax2.ri.Stax2EventWriterImpl.add(Stax2EventWriterImpl.java:171)
at org.teiid.query.function.source.XMLSystemFunctions$8.translate(XMLSystemFunctions.java:1012)
at org.teiid.query.function.source.XMLSystemFunctions.saveToBufferManager(XMLSystemFunctions.java:1087)
at org.teiid.query.function.source.XMLSystemFunctions.jsonToXml(XMLSystemFunctions.java:1003)
at org.teiid.query.function.source.XMLSystemFunctions.jsonToXml(XMLSystemFunctions.java:983)
at org.teiid.query.function.source.XMLSystemFunctions.jsonToXml(XMLSystemFunctions.java:979)
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:498)
at org.teiid.query.function.FunctionDescriptor.invokeFunction(FunctionDescriptor.java:275)
... 35 more
{code}
I know that Teiid now contains totally json-simple library source code and the bug can be fixed quickly, something similar was reported here: https://github.com/fangyidong/json-simple/issues/57, later merged to https://github.com/fangyidong/json-simple/issues/73 issue but there is also another fork of the json-simple lib, here is the link: https://github.com/cliftonlabs/json-simple, author of the library claimed that he had already fixed the bug there, here is list of fixed bugs and features: https://cliftonlabs.github.io/json-simple/ but the main problem is that the forked library is not compatible anymore with original json-simple library but maybe we can take some changes from there to fix the original bug described here.
was:
Running the following query:
{code:sql}
select jsontoxml('root','{
"items" : [{
"ordernumber" : "NL0000026010",
"orderdate" : "2016-01-01T01:13:39Z",
"orderdate_ts" : "01-01-2016 01:13:39",
"totalprice" : 24.8,
"total_order_price" : 24.8,
"vatvalue" : 4.3,
"vatrate" : 21,
"vatcustomernumber" : null,
"odr_description" : null,
"odr_note" : null,
"rest_status" : "pending",
"shipping_minimum_date" : null,
"shipping_maximum_date" : null,
"order_source" : "Magento",
"oss_id" : 131458290409912116350633678684356778292}, {
"ordernumber" : "NL0000026011",
"orderdate" : "2016-01-01T06:52:05Z",
"orderdate_ts" : "01-01-2016 06:52:05",
"totalprice" : 27.85,
"total_order_price" : 27.85,
"vatvalue" : 4.84,
"vatrate" : 21,
"vatcustomernumber" : null,
"odr_description" : null,
"odr_note" : null,
"rest_status" : "pending",
"shipping_minimum_date" : null,
"shipping_maximum_date" : null,
"order_source" : "Magento",
"oss_id" : 131458290409912116350633678684356778292
}
],
"hasMore" : true,
"limit" : 10,
"offset" : 0,
"count" : 10
}') ;;
{code}
fails with the following error message:
{code:noformat}
15:30:44,531 WARN [org.teiid.PROCESSOR] (Worker0_QueryProcessorQueue5) p69Z3QNLg3hP TEIID30020 Processing exception for request p69Z3QNLg3hP.0 'TEIID30328 Unable to evaluate jsontoxml('root', ?): TEIID30384 Error while evaluating function jsontoxml'. Originally ExpressionEvaluationException 'For input string: "131458290409912116350633678684356778292"' NumberFormatException.java:65.: org.teiid.api.exception.query.ExpressionEvaluationException: TEIID30328 Unable to evaluate jsontoxml('root', ?): TEIID30384 Error while evaluating function jsontoxml
at org.teiid.query.eval.Evaluator.evaluate(Evaluator.java:709)
at org.teiid.query.rewriter.QueryRewriter.evaluate(QueryRewriter.java:2295)
at org.teiid.query.rewriter.QueryRewriter.rewriteExpressionDirect(QueryRewriter.java:2285)
at org.teiid.query.rewriter.QueryRewriter.access$000(QueryRewriter.java:105)
at org.teiid.query.rewriter.QueryRewriter$2.replaceExpression(QueryRewriter.java:767)
at org.teiid.query.sql.visitor.ExpressionMappingVisitor.visit(ExpressionMappingVisitor.java:158)
at org.teiid.query.sql.symbol.ExpressionSymbol.acceptVisitor(ExpressionSymbol.java:59)
at org.teiid.query.sql.navigator.AbstractNavigator.visitVisitor(AbstractNavigator.java:50)
at org.teiid.query.sql.navigator.PreOrPostOrderNavigator.postVisitVisitor(PreOrPostOrderNavigator.java:57)
at org.teiid.query.sql.navigator.PreOrPostOrderNavigator.visit(PreOrPostOrderNavigator.java:179)
at org.teiid.query.sql.symbol.ExpressionSymbol.acceptVisitor(ExpressionSymbol.java:59)
at org.teiid.query.sql.navigator.AbstractNavigator.visitNode(AbstractNavigator.java:59)
at org.teiid.query.sql.navigator.AbstractNavigator.visitNodes(AbstractNavigator.java:72)
at org.teiid.query.sql.navigator.PreOrPostOrderNavigator.visit(PreOrPostOrderNavigator.java:338)
at org.teiid.query.sql.lang.Select.acceptVisitor(Select.java:164)
at org.teiid.query.sql.navigator.PostOrderNavigator.doVisit(PostOrderNavigator.java:36)
at org.teiid.query.rewriter.QueryRewriter.rewriteExpressions(QueryRewriter.java:774)
at org.teiid.query.rewriter.QueryRewriter.rewriteQuery(QueryRewriter.java:559)
at org.teiid.query.rewriter.QueryRewriter.rewriteCommand(QueryRewriter.java:269)
at org.teiid.query.rewriter.QueryRewriter.rewrite(QueryRewriter.java:172)
at org.teiid.query.rewriter.QueryRewriter.rewrite(QueryRewriter.java:176)
at org.teiid.dqp.internal.process.Request.generatePlan(Request.java:436)
at org.teiid.dqp.internal.process.Request.processRequest(Request.java:486)
at org.teiid.dqp.internal.process.RequestWorkItem.processNew(RequestWorkItem.java:660)
at org.teiid.dqp.internal.process.RequestWorkItem.process(RequestWorkItem.java:339)
at org.teiid.dqp.internal.process.AbstractWorkItem.run(AbstractWorkItem.java:47)
at org.teiid.dqp.internal.process.RequestWorkItem.run(RequestWorkItem.java:276)
at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:277)
at org.teiid.dqp.internal.process.ThreadReuseExecutor$RunnableWrapper.run(ThreadReuseExecutor.java:115)
at org.teiid.dqp.internal.process.ThreadReuseExecutor$3.run(ThreadReuseExecutor.java:206)
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: org.teiid.api.exception.query.FunctionExecutionException: TEIID30384 Error while evaluating function jsontoxml
at org.teiid.query.function.FunctionDescriptor.invokeFunction(FunctionDescriptor.java:289)
at org.teiid.query.eval.Evaluator.evaluate(Evaluator.java:1309)
at org.teiid.query.eval.Evaluator.internalEvaluate(Evaluator.java:741)
at org.teiid.query.eval.Evaluator.evaluate(Evaluator.java:707)
... 32 more
Caused by: java.lang.NumberFormatException: For input string: "131458290409912116350633678684356778292"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.lang.Long.parseLong(Long.java:592)
at java.lang.Long.valueOf(Long.java:803)
at org.teiid.json.simple.Yylex.yylex(Yylex.java:662)
at org.teiid.json.simple.JSONParser.nextToken(JSONParser.java:125)
at org.teiid.json.simple.JSONParser.parse(JSONParser.java:257)
at org.teiid.query.function.source.XMLSystemFunctions$JsonToXmlContentHandler.nextEvent(XMLSystemFunctions.java:354)
at org.codehaus.stax2.ri.Stax2EventWriterImpl.add(Stax2EventWriterImpl.java:171)
at org.teiid.query.function.source.XMLSystemFunctions$8.translate(XMLSystemFunctions.java:1012)
at org.teiid.query.function.source.XMLSystemFunctions.saveToBufferManager(XMLSystemFunctions.java:1087)
at org.teiid.query.function.source.XMLSystemFunctions.jsonToXml(XMLSystemFunctions.java:1003)
at org.teiid.query.function.source.XMLSystemFunctions.jsonToXml(XMLSystemFunctions.java:983)
at org.teiid.query.function.source.XMLSystemFunctions.jsonToXml(XMLSystemFunctions.java:979)
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:498)
at org.teiid.query.function.FunctionDescriptor.invokeFunction(FunctionDescriptor.java:275)
... 35 more
{code}
I know that Teiid now contains totally json-simple library source code and the bug can be fixed quickly, something similar was reported here: https://github.com/fangyidong/json-simple/issues/57, later merged to https://github.com/fangyidong/json-simple/issues/73 issue but there is also another fork of the json-simple lib, here is the link: https://github.com/cliftonlabs/json-simple, author of the library claimed that he had already fixed the bug there, here is list of fixed bugs and features: https://cliftonlabs.github.io/json-simple/ but the main problem is that the forked library is not compatible anymore with original json-simple library but maybe we can take some changes from there to fix the original bug described here.
> JSONTOXML fails on parsing too long numbers
> -------------------------------------------
>
> Key: TEIID-5368
> URL: https://issues.jboss.org/browse/TEIID-5368
> Project: Teiid
> Issue Type: Bug
> Components: Query Engine
> Affects Versions: 10.2
> Environment: teiid-10.2.0 on WildFly Full 11.0.0.Final (WildFly Core 3.0.8.Final)
> Reporter: dalex dalex
> Assignee: Steven Hawkins
> Priority: Blocker
>
> Running the following query:
> {code:noformat}
> select jsontoxml('root','{
> "items" : [{
> "ordernumber" : "NL0000026010",
> "orderdate" : "2016-01-01T01:13:39Z",
> "orderdate_ts" : "01-01-2016 01:13:39",
> "totalprice" : 24.8,
> "total_order_price" : 24.8,
> "vatvalue" : 4.3,
> "vatrate" : 21,
> "vatcustomernumber" : null,
> "odr_description" : null,
> "odr_note" : null,
> "rest_status" : "pending",
> "shipping_minimum_date" : null,
> "shipping_maximum_date" : null,
> "order_source" : "Magento",
> "oss_id" : 131458290409912116350633678684356778292}, {
> "ordernumber" : "NL0000026011",
> "orderdate" : "2016-01-01T06:52:05Z",
> "orderdate_ts" : "01-01-2016 06:52:05",
> "totalprice" : 27.85,
> "total_order_price" : 27.85,
> "vatvalue" : 4.84,
> "vatrate" : 21,
> "vatcustomernumber" : null,
> "odr_description" : null,
> "odr_note" : null,
> "rest_status" : "pending",
> "shipping_minimum_date" : null,
> "shipping_maximum_date" : null,
> "order_source" : "Magento",
> "oss_id" : 131458290409912116350633678684356778292
> }
> ],
> "hasMore" : true,
> "limit" : 10,
> "offset" : 0,
> "count" : 10
> }') ;;
> {code}
> fails with the following error message:
> {code:noformat}
> 15:30:44,531 WARN [org.teiid.PROCESSOR] (Worker0_QueryProcessorQueue5) p69Z3QNLg3hP TEIID30020 Processing exception for request p69Z3QNLg3hP.0 'TEIID30328 Unable to evaluate jsontoxml('root', ?): TEIID30384 Error while evaluating function jsontoxml'. Originally ExpressionEvaluationException 'For input string: "131458290409912116350633678684356778292"' NumberFormatException.java:65.: org.teiid.api.exception.query.ExpressionEvaluationException: TEIID30328 Unable to evaluate jsontoxml('root', ?): TEIID30384 Error while evaluating function jsontoxml
> at org.teiid.query.eval.Evaluator.evaluate(Evaluator.java:709)
> at org.teiid.query.rewriter.QueryRewriter.evaluate(QueryRewriter.java:2295)
> at org.teiid.query.rewriter.QueryRewriter.rewriteExpressionDirect(QueryRewriter.java:2285)
> at org.teiid.query.rewriter.QueryRewriter.access$000(QueryRewriter.java:105)
> at org.teiid.query.rewriter.QueryRewriter$2.replaceExpression(QueryRewriter.java:767)
> at org.teiid.query.sql.visitor.ExpressionMappingVisitor.visit(ExpressionMappingVisitor.java:158)
> at org.teiid.query.sql.symbol.ExpressionSymbol.acceptVisitor(ExpressionSymbol.java:59)
> at org.teiid.query.sql.navigator.AbstractNavigator.visitVisitor(AbstractNavigator.java:50)
> at org.teiid.query.sql.navigator.PreOrPostOrderNavigator.postVisitVisitor(PreOrPostOrderNavigator.java:57)
> at org.teiid.query.sql.navigator.PreOrPostOrderNavigator.visit(PreOrPostOrderNavigator.java:179)
> at org.teiid.query.sql.symbol.ExpressionSymbol.acceptVisitor(ExpressionSymbol.java:59)
> at org.teiid.query.sql.navigator.AbstractNavigator.visitNode(AbstractNavigator.java:59)
> at org.teiid.query.sql.navigator.AbstractNavigator.visitNodes(AbstractNavigator.java:72)
> at org.teiid.query.sql.navigator.PreOrPostOrderNavigator.visit(PreOrPostOrderNavigator.java:338)
> at org.teiid.query.sql.lang.Select.acceptVisitor(Select.java:164)
> at org.teiid.query.sql.navigator.PostOrderNavigator.doVisit(PostOrderNavigator.java:36)
> at org.teiid.query.rewriter.QueryRewriter.rewriteExpressions(QueryRewriter.java:774)
> at org.teiid.query.rewriter.QueryRewriter.rewriteQuery(QueryRewriter.java:559)
> at org.teiid.query.rewriter.QueryRewriter.rewriteCommand(QueryRewriter.java:269)
> at org.teiid.query.rewriter.QueryRewriter.rewrite(QueryRewriter.java:172)
> at org.teiid.query.rewriter.QueryRewriter.rewrite(QueryRewriter.java:176)
> at org.teiid.dqp.internal.process.Request.generatePlan(Request.java:436)
> at org.teiid.dqp.internal.process.Request.processRequest(Request.java:486)
> at org.teiid.dqp.internal.process.RequestWorkItem.processNew(RequestWorkItem.java:660)
> at org.teiid.dqp.internal.process.RequestWorkItem.process(RequestWorkItem.java:339)
> at org.teiid.dqp.internal.process.AbstractWorkItem.run(AbstractWorkItem.java:47)
> at org.teiid.dqp.internal.process.RequestWorkItem.run(RequestWorkItem.java:276)
> at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:277)
> at org.teiid.dqp.internal.process.ThreadReuseExecutor$RunnableWrapper.run(ThreadReuseExecutor.java:115)
> at org.teiid.dqp.internal.process.ThreadReuseExecutor$3.run(ThreadReuseExecutor.java:206)
> 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: org.teiid.api.exception.query.FunctionExecutionException: TEIID30384 Error while evaluating function jsontoxml
> at org.teiid.query.function.FunctionDescriptor.invokeFunction(FunctionDescriptor.java:289)
> at org.teiid.query.eval.Evaluator.evaluate(Evaluator.java:1309)
> at org.teiid.query.eval.Evaluator.internalEvaluate(Evaluator.java:741)
> at org.teiid.query.eval.Evaluator.evaluate(Evaluator.java:707)
> ... 32 more
> Caused by: java.lang.NumberFormatException: For input string: "131458290409912116350633678684356778292"
> at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
> at java.lang.Long.parseLong(Long.java:592)
> at java.lang.Long.valueOf(Long.java:803)
> at org.teiid.json.simple.Yylex.yylex(Yylex.java:662)
> at org.teiid.json.simple.JSONParser.nextToken(JSONParser.java:125)
> at org.teiid.json.simple.JSONParser.parse(JSONParser.java:257)
> at org.teiid.query.function.source.XMLSystemFunctions$JsonToXmlContentHandler.nextEvent(XMLSystemFunctions.java:354)
> at org.codehaus.stax2.ri.Stax2EventWriterImpl.add(Stax2EventWriterImpl.java:171)
> at org.teiid.query.function.source.XMLSystemFunctions$8.translate(XMLSystemFunctions.java:1012)
> at org.teiid.query.function.source.XMLSystemFunctions.saveToBufferManager(XMLSystemFunctions.java:1087)
> at org.teiid.query.function.source.XMLSystemFunctions.jsonToXml(XMLSystemFunctions.java:1003)
> at org.teiid.query.function.source.XMLSystemFunctions.jsonToXml(XMLSystemFunctions.java:983)
> at org.teiid.query.function.source.XMLSystemFunctions.jsonToXml(XMLSystemFunctions.java:979)
> 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:498)
> at org.teiid.query.function.FunctionDescriptor.invokeFunction(FunctionDescriptor.java:275)
> ... 35 more
> {code}
> I know that Teiid now contains totally json-simple library source code and the bug can be fixed quickly, something similar was reported here: https://github.com/fangyidong/json-simple/issues/57, later merged to https://github.com/fangyidong/json-simple/issues/73 issue but there is also another fork of the json-simple lib, here is the link: https://github.com/cliftonlabs/json-simple, author of the library claimed that he had already fixed the bug there, here is list of fixed bugs and features: https://cliftonlabs.github.io/json-simple/ but the main problem is that the forked library is not compatible anymore with original json-simple library but maybe we can take some changes from there to fix the original bug described here.
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
6 years, 7 months
[JBoss JIRA] (TEIID-5368) JSONTOXML fails on parsing too long numbers
by dalex dalex (JIRA)
[ https://issues.jboss.org/browse/TEIID-5368?page=com.atlassian.jira.plugin... ]
dalex dalex updated TEIID-5368:
-------------------------------
Steps to Reproduce:
Run the following query:
{code:noformat}
select jsontoxml('root','{
"items" : [{
"ordernumber" : "NL0000026010",
"orderdate" : "2016-01-01T01:13:39Z",
"orderdate_ts" : "01-01-2016 01:13:39",
"totalprice" : 24.8,
"total_order_price" : 24.8,
"vatvalue" : 4.3,
"vatrate" : 21,
"vatcustomernumber" : null,
"odr_description" : null,
"odr_note" : null,
"rest_status" : "pending",
"shipping_minimum_date" : null,
"shipping_maximum_date" : null,
"order_source" : "Magento",
"oss_id" : 131458290409912116350633678684356778292}, {
"ordernumber" : "NL0000026011",
"orderdate" : "2016-01-01T06:52:05Z",
"orderdate_ts" : "01-01-2016 06:52:05",
"totalprice" : 27.85,
"total_order_price" : 27.85,
"vatvalue" : 4.84,
"vatrate" : 21,
"vatcustomernumber" : null,
"odr_description" : null,
"odr_note" : null,
"rest_status" : "pending",
"shipping_minimum_date" : null,
"shipping_maximum_date" : null,
"order_source" : "Magento",
"oss_id" : 131458290409912116350633678684356778292
}
],
"hasMore" : true,
"limit" : 10,
"offset" : 0,
"count" : 10
}') ;;
{code}
was:
Run the following query:
{code:sql}
select jsontoxml('root','{
"items" : [{
"ordernumber" : "NL0000026010",
"orderdate" : "2016-01-01T01:13:39Z",
"orderdate_ts" : "01-01-2016 01:13:39",
"totalprice" : 24.8,
"total_order_price" : 24.8,
"vatvalue" : 4.3,
"vatrate" : 21,
"vatcustomernumber" : null,
"odr_description" : null,
"odr_note" : null,
"rest_status" : "pending",
"shipping_minimum_date" : null,
"shipping_maximum_date" : null,
"order_source" : "Magento",
"oss_id" : 131458290409912116350633678684356778292}, {
"ordernumber" : "NL0000026011",
"orderdate" : "2016-01-01T06:52:05Z",
"orderdate_ts" : "01-01-2016 06:52:05",
"totalprice" : 27.85,
"total_order_price" : 27.85,
"vatvalue" : 4.84,
"vatrate" : 21,
"vatcustomernumber" : null,
"odr_description" : null,
"odr_note" : null,
"rest_status" : "pending",
"shipping_minimum_date" : null,
"shipping_maximum_date" : null,
"order_source" : "Magento",
"oss_id" : 131458290409912116350633678684356778292
}
],
"hasMore" : true,
"limit" : 10,
"offset" : 0,
"count" : 10
}') ;;
{code}
> JSONTOXML fails on parsing too long numbers
> -------------------------------------------
>
> Key: TEIID-5368
> URL: https://issues.jboss.org/browse/TEIID-5368
> Project: Teiid
> Issue Type: Bug
> Components: Query Engine
> Affects Versions: 10.2
> Environment: teiid-10.2.0 on WildFly Full 11.0.0.Final (WildFly Core 3.0.8.Final)
> Reporter: dalex dalex
> Assignee: Steven Hawkins
> Priority: Blocker
>
> Running the following query:
> {code:sql}
> select jsontoxml('root','{
> "items" : [{
> "ordernumber" : "NL0000026010",
> "orderdate" : "2016-01-01T01:13:39Z",
> "orderdate_ts" : "01-01-2016 01:13:39",
> "totalprice" : 24.8,
> "total_order_price" : 24.8,
> "vatvalue" : 4.3,
> "vatrate" : 21,
> "vatcustomernumber" : null,
> "odr_description" : null,
> "odr_note" : null,
> "rest_status" : "pending",
> "shipping_minimum_date" : null,
> "shipping_maximum_date" : null,
> "order_source" : "Magento",
> "oss_id" : 131458290409912116350633678684356778292}, {
> "ordernumber" : "NL0000026011",
> "orderdate" : "2016-01-01T06:52:05Z",
> "orderdate_ts" : "01-01-2016 06:52:05",
> "totalprice" : 27.85,
> "total_order_price" : 27.85,
> "vatvalue" : 4.84,
> "vatrate" : 21,
> "vatcustomernumber" : null,
> "odr_description" : null,
> "odr_note" : null,
> "rest_status" : "pending",
> "shipping_minimum_date" : null,
> "shipping_maximum_date" : null,
> "order_source" : "Magento",
> "oss_id" : 131458290409912116350633678684356778292
> }
> ],
> "hasMore" : true,
> "limit" : 10,
> "offset" : 0,
> "count" : 10
> }') ;;
> {code}
> fails with the following error message:
> {code:noformat}
> 15:30:44,531 WARN [org.teiid.PROCESSOR] (Worker0_QueryProcessorQueue5) p69Z3QNLg3hP TEIID30020 Processing exception for request p69Z3QNLg3hP.0 'TEIID30328 Unable to evaluate jsontoxml('root', ?): TEIID30384 Error while evaluating function jsontoxml'. Originally ExpressionEvaluationException 'For input string: "131458290409912116350633678684356778292"' NumberFormatException.java:65.: org.teiid.api.exception.query.ExpressionEvaluationException: TEIID30328 Unable to evaluate jsontoxml('root', ?): TEIID30384 Error while evaluating function jsontoxml
> at org.teiid.query.eval.Evaluator.evaluate(Evaluator.java:709)
> at org.teiid.query.rewriter.QueryRewriter.evaluate(QueryRewriter.java:2295)
> at org.teiid.query.rewriter.QueryRewriter.rewriteExpressionDirect(QueryRewriter.java:2285)
> at org.teiid.query.rewriter.QueryRewriter.access$000(QueryRewriter.java:105)
> at org.teiid.query.rewriter.QueryRewriter$2.replaceExpression(QueryRewriter.java:767)
> at org.teiid.query.sql.visitor.ExpressionMappingVisitor.visit(ExpressionMappingVisitor.java:158)
> at org.teiid.query.sql.symbol.ExpressionSymbol.acceptVisitor(ExpressionSymbol.java:59)
> at org.teiid.query.sql.navigator.AbstractNavigator.visitVisitor(AbstractNavigator.java:50)
> at org.teiid.query.sql.navigator.PreOrPostOrderNavigator.postVisitVisitor(PreOrPostOrderNavigator.java:57)
> at org.teiid.query.sql.navigator.PreOrPostOrderNavigator.visit(PreOrPostOrderNavigator.java:179)
> at org.teiid.query.sql.symbol.ExpressionSymbol.acceptVisitor(ExpressionSymbol.java:59)
> at org.teiid.query.sql.navigator.AbstractNavigator.visitNode(AbstractNavigator.java:59)
> at org.teiid.query.sql.navigator.AbstractNavigator.visitNodes(AbstractNavigator.java:72)
> at org.teiid.query.sql.navigator.PreOrPostOrderNavigator.visit(PreOrPostOrderNavigator.java:338)
> at org.teiid.query.sql.lang.Select.acceptVisitor(Select.java:164)
> at org.teiid.query.sql.navigator.PostOrderNavigator.doVisit(PostOrderNavigator.java:36)
> at org.teiid.query.rewriter.QueryRewriter.rewriteExpressions(QueryRewriter.java:774)
> at org.teiid.query.rewriter.QueryRewriter.rewriteQuery(QueryRewriter.java:559)
> at org.teiid.query.rewriter.QueryRewriter.rewriteCommand(QueryRewriter.java:269)
> at org.teiid.query.rewriter.QueryRewriter.rewrite(QueryRewriter.java:172)
> at org.teiid.query.rewriter.QueryRewriter.rewrite(QueryRewriter.java:176)
> at org.teiid.dqp.internal.process.Request.generatePlan(Request.java:436)
> at org.teiid.dqp.internal.process.Request.processRequest(Request.java:486)
> at org.teiid.dqp.internal.process.RequestWorkItem.processNew(RequestWorkItem.java:660)
> at org.teiid.dqp.internal.process.RequestWorkItem.process(RequestWorkItem.java:339)
> at org.teiid.dqp.internal.process.AbstractWorkItem.run(AbstractWorkItem.java:47)
> at org.teiid.dqp.internal.process.RequestWorkItem.run(RequestWorkItem.java:276)
> at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:277)
> at org.teiid.dqp.internal.process.ThreadReuseExecutor$RunnableWrapper.run(ThreadReuseExecutor.java:115)
> at org.teiid.dqp.internal.process.ThreadReuseExecutor$3.run(ThreadReuseExecutor.java:206)
> 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: org.teiid.api.exception.query.FunctionExecutionException: TEIID30384 Error while evaluating function jsontoxml
> at org.teiid.query.function.FunctionDescriptor.invokeFunction(FunctionDescriptor.java:289)
> at org.teiid.query.eval.Evaluator.evaluate(Evaluator.java:1309)
> at org.teiid.query.eval.Evaluator.internalEvaluate(Evaluator.java:741)
> at org.teiid.query.eval.Evaluator.evaluate(Evaluator.java:707)
> ... 32 more
> Caused by: java.lang.NumberFormatException: For input string: "131458290409912116350633678684356778292"
> at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
> at java.lang.Long.parseLong(Long.java:592)
> at java.lang.Long.valueOf(Long.java:803)
> at org.teiid.json.simple.Yylex.yylex(Yylex.java:662)
> at org.teiid.json.simple.JSONParser.nextToken(JSONParser.java:125)
> at org.teiid.json.simple.JSONParser.parse(JSONParser.java:257)
> at org.teiid.query.function.source.XMLSystemFunctions$JsonToXmlContentHandler.nextEvent(XMLSystemFunctions.java:354)
> at org.codehaus.stax2.ri.Stax2EventWriterImpl.add(Stax2EventWriterImpl.java:171)
> at org.teiid.query.function.source.XMLSystemFunctions$8.translate(XMLSystemFunctions.java:1012)
> at org.teiid.query.function.source.XMLSystemFunctions.saveToBufferManager(XMLSystemFunctions.java:1087)
> at org.teiid.query.function.source.XMLSystemFunctions.jsonToXml(XMLSystemFunctions.java:1003)
> at org.teiid.query.function.source.XMLSystemFunctions.jsonToXml(XMLSystemFunctions.java:983)
> at org.teiid.query.function.source.XMLSystemFunctions.jsonToXml(XMLSystemFunctions.java:979)
> 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:498)
> at org.teiid.query.function.FunctionDescriptor.invokeFunction(FunctionDescriptor.java:275)
> ... 35 more
> {code}
> I know that Teiid now contains totally json-simple library source code and the bug can be fixed quickly, something similar was reported here: https://github.com/fangyidong/json-simple/issues/57, later merged to https://github.com/fangyidong/json-simple/issues/73 issue but there is also another fork of the json-simple lib, here is the link: https://github.com/cliftonlabs/json-simple, author of the library claimed that he had already fixed the bug there, here is list of fixed bugs and features: https://cliftonlabs.github.io/json-simple/ but the main problem is that the forked library is not compatible anymore with original json-simple library but maybe we can take some changes from there to fix the original bug described here.
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
6 years, 7 months
[JBoss JIRA] (TEIID-5368) JSONTOXML fails on parsing too long numbers
by dalex dalex (JIRA)
dalex dalex created TEIID-5368:
----------------------------------
Summary: JSONTOXML fails on parsing too long numbers
Key: TEIID-5368
URL: https://issues.jboss.org/browse/TEIID-5368
Project: Teiid
Issue Type: Bug
Components: Query Engine
Affects Versions: 10.2
Environment: teiid-10.2.0 on WildFly Full 11.0.0.Final (WildFly Core 3.0.8.Final)
Reporter: dalex dalex
Assignee: Steven Hawkins
Priority: Blocker
Running the following query:
{code:sql}
select jsontoxml('root','{
"items" : [{
"ordernumber" : "NL0000026010",
"orderdate" : "2016-01-01T01:13:39Z",
"orderdate_ts" : "01-01-2016 01:13:39",
"totalprice" : 24.8,
"total_order_price" : 24.8,
"vatvalue" : 4.3,
"vatrate" : 21,
"vatcustomernumber" : null,
"odr_description" : null,
"odr_note" : null,
"rest_status" : "pending",
"shipping_minimum_date" : null,
"shipping_maximum_date" : null,
"order_source" : "Magento",
"oss_id" : 131458290409912116350633678684356778292}, {
"ordernumber" : "NL0000026011",
"orderdate" : "2016-01-01T06:52:05Z",
"orderdate_ts" : "01-01-2016 06:52:05",
"totalprice" : 27.85,
"total_order_price" : 27.85,
"vatvalue" : 4.84,
"vatrate" : 21,
"vatcustomernumber" : null,
"odr_description" : null,
"odr_note" : null,
"rest_status" : "pending",
"shipping_minimum_date" : null,
"shipping_maximum_date" : null,
"order_source" : "Magento",
"oss_id" : 131458290409912116350633678684356778292
}
],
"hasMore" : true,
"limit" : 10,
"offset" : 0,
"count" : 10
}') ;;
{code}
fails with the following error message:
{code:noformat}
15:30:44,531 WARN [org.teiid.PROCESSOR] (Worker0_QueryProcessorQueue5) p69Z3QNLg3hP TEIID30020 Processing exception for request p69Z3QNLg3hP.0 'TEIID30328 Unable to evaluate jsontoxml('root', ?): TEIID30384 Error while evaluating function jsontoxml'. Originally ExpressionEvaluationException 'For input string: "131458290409912116350633678684356778292"' NumberFormatException.java:65.: org.teiid.api.exception.query.ExpressionEvaluationException: TEIID30328 Unable to evaluate jsontoxml('root', ?): TEIID30384 Error while evaluating function jsontoxml
at org.teiid.query.eval.Evaluator.evaluate(Evaluator.java:709)
at org.teiid.query.rewriter.QueryRewriter.evaluate(QueryRewriter.java:2295)
at org.teiid.query.rewriter.QueryRewriter.rewriteExpressionDirect(QueryRewriter.java:2285)
at org.teiid.query.rewriter.QueryRewriter.access$000(QueryRewriter.java:105)
at org.teiid.query.rewriter.QueryRewriter$2.replaceExpression(QueryRewriter.java:767)
at org.teiid.query.sql.visitor.ExpressionMappingVisitor.visit(ExpressionMappingVisitor.java:158)
at org.teiid.query.sql.symbol.ExpressionSymbol.acceptVisitor(ExpressionSymbol.java:59)
at org.teiid.query.sql.navigator.AbstractNavigator.visitVisitor(AbstractNavigator.java:50)
at org.teiid.query.sql.navigator.PreOrPostOrderNavigator.postVisitVisitor(PreOrPostOrderNavigator.java:57)
at org.teiid.query.sql.navigator.PreOrPostOrderNavigator.visit(PreOrPostOrderNavigator.java:179)
at org.teiid.query.sql.symbol.ExpressionSymbol.acceptVisitor(ExpressionSymbol.java:59)
at org.teiid.query.sql.navigator.AbstractNavigator.visitNode(AbstractNavigator.java:59)
at org.teiid.query.sql.navigator.AbstractNavigator.visitNodes(AbstractNavigator.java:72)
at org.teiid.query.sql.navigator.PreOrPostOrderNavigator.visit(PreOrPostOrderNavigator.java:338)
at org.teiid.query.sql.lang.Select.acceptVisitor(Select.java:164)
at org.teiid.query.sql.navigator.PostOrderNavigator.doVisit(PostOrderNavigator.java:36)
at org.teiid.query.rewriter.QueryRewriter.rewriteExpressions(QueryRewriter.java:774)
at org.teiid.query.rewriter.QueryRewriter.rewriteQuery(QueryRewriter.java:559)
at org.teiid.query.rewriter.QueryRewriter.rewriteCommand(QueryRewriter.java:269)
at org.teiid.query.rewriter.QueryRewriter.rewrite(QueryRewriter.java:172)
at org.teiid.query.rewriter.QueryRewriter.rewrite(QueryRewriter.java:176)
at org.teiid.dqp.internal.process.Request.generatePlan(Request.java:436)
at org.teiid.dqp.internal.process.Request.processRequest(Request.java:486)
at org.teiid.dqp.internal.process.RequestWorkItem.processNew(RequestWorkItem.java:660)
at org.teiid.dqp.internal.process.RequestWorkItem.process(RequestWorkItem.java:339)
at org.teiid.dqp.internal.process.AbstractWorkItem.run(AbstractWorkItem.java:47)
at org.teiid.dqp.internal.process.RequestWorkItem.run(RequestWorkItem.java:276)
at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:277)
at org.teiid.dqp.internal.process.ThreadReuseExecutor$RunnableWrapper.run(ThreadReuseExecutor.java:115)
at org.teiid.dqp.internal.process.ThreadReuseExecutor$3.run(ThreadReuseExecutor.java:206)
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: org.teiid.api.exception.query.FunctionExecutionException: TEIID30384 Error while evaluating function jsontoxml
at org.teiid.query.function.FunctionDescriptor.invokeFunction(FunctionDescriptor.java:289)
at org.teiid.query.eval.Evaluator.evaluate(Evaluator.java:1309)
at org.teiid.query.eval.Evaluator.internalEvaluate(Evaluator.java:741)
at org.teiid.query.eval.Evaluator.evaluate(Evaluator.java:707)
... 32 more
Caused by: java.lang.NumberFormatException: For input string: "131458290409912116350633678684356778292"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.lang.Long.parseLong(Long.java:592)
at java.lang.Long.valueOf(Long.java:803)
at org.teiid.json.simple.Yylex.yylex(Yylex.java:662)
at org.teiid.json.simple.JSONParser.nextToken(JSONParser.java:125)
at org.teiid.json.simple.JSONParser.parse(JSONParser.java:257)
at org.teiid.query.function.source.XMLSystemFunctions$JsonToXmlContentHandler.nextEvent(XMLSystemFunctions.java:354)
at org.codehaus.stax2.ri.Stax2EventWriterImpl.add(Stax2EventWriterImpl.java:171)
at org.teiid.query.function.source.XMLSystemFunctions$8.translate(XMLSystemFunctions.java:1012)
at org.teiid.query.function.source.XMLSystemFunctions.saveToBufferManager(XMLSystemFunctions.java:1087)
at org.teiid.query.function.source.XMLSystemFunctions.jsonToXml(XMLSystemFunctions.java:1003)
at org.teiid.query.function.source.XMLSystemFunctions.jsonToXml(XMLSystemFunctions.java:983)
at org.teiid.query.function.source.XMLSystemFunctions.jsonToXml(XMLSystemFunctions.java:979)
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:498)
at org.teiid.query.function.FunctionDescriptor.invokeFunction(FunctionDescriptor.java:275)
... 35 more
{code}
I know that Teiid now contains totally json-simple library source code and the bug can be fixed quickly, something similar was reported here: https://github.com/fangyidong/json-simple/issues/57, later merged to https://github.com/fangyidong/json-simple/issues/73 issue but there is also another fork of the json-simple lib, here is the link: https://github.com/cliftonlabs/json-simple, author of the library claimed that he had already fixed the bug there, here is list of fixed bugs and features: https://cliftonlabs.github.io/json-simple/ but the main problem is that the forked library is not compatible anymore with original json-simple library but maybe we can take some changes from there to fix the original bug described here.
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
6 years, 7 months
[JBoss JIRA] (TEIID-4532) Provide one-way or cryptographic hash functions
by RH Bugzilla Integration (JIRA)
[ https://issues.jboss.org/browse/TEIID-4532?page=com.atlassian.jira.plugin... ]
RH Bugzilla Integration updated TEIID-4532:
-------------------------------------------
Bugzilla References: https://bugzilla.redhat.com/show_bug.cgi?id=1588656
Bugzilla Update: Perform
> Provide one-way or cryptographic hash functions
> -----------------------------------------------
>
> Key: TEIID-4532
> URL: https://issues.jboss.org/browse/TEIID-4532
> Project: Teiid
> Issue Type: Feature Request
> Components: Query Engine
> Affects Versions: 9.2
> Reporter: Van Halbert
> Assignee: Steven Hawkins
> Fix For: 9.2
>
>
> Provide one-way or [cryptographic hash functions|https://en.wikipedia.org/wiki/SHA-3#Comparison_of_SHA_functions], such as any of the MD5, SHA-1, SHA-2, or SHA-3 functions, so that views can define columns that are hashes of other columns.
> The goal is to allow views to hide some columns (e.g., personally identifying information), but to expose a new "primary key" that is a hash of other existing columns. So, given this source table:
> {code:sql}
> CREATE TABLE person (
> id INT PRIMARY KEY,
> name VARCHAR(256) NOT NULL,
> age INT,
> height INT,
> weight DOUBLE
> );
> {code}
> a view could be created to hide the personally identifying information:
> {code:sql}
> CREATE VIEW anonymousPerson ()
> id VARCHAR(64) PRIMARY KEY,
> age INT,
> height INT,
> weight DOUBLE
> ) AS
> SELECT sha256(p.id, p.name) AS id,
> p.age AS age,
> p.height AS height,
> p.weight AS weight
> FROM person AS p;
> {code}
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
6 years, 7 months
[JBoss JIRA] (TEIID-5367) Table names cannot begin with . or contain repeated .
by Steven Hawkins (JIRA)
Steven Hawkins created TEIID-5367:
-------------------------------------
Summary: Table names cannot begin with . or contain repeated .
Key: TEIID-5367
URL: https://issues.jboss.org/browse/TEIID-5367
Project: Teiid
Issue Type: Bug
Components: Query Engine
Reporter: Steven Hawkins
Assignee: Steven Hawkins
Fix For: 11.0
Although unlikely there are some restrictions on table names based upon the stringification and other logic.
select * from ".tbl"
or
select * from "tbl..name"
both result in an exception.
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
6 years, 7 months
[JBoss JIRA] (TEIID-3439) Add support for aliases with .
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-3439?page=com.atlassian.jira.plugin... ]
Steven Hawkins commented on TEIID-3439:
---------------------------------------
Looking at this again for 11. For the tableau issue the workaround is have table names that do not contain . which can be achieved by importing without any qualification (meaning that multiple source schemas may need to be in muliple Teiid schemas).
It looks like I can get this working in Teiid proper for table aliases, but there are quite a few bad side effects to reduce. Due to our lax naming you could do:
select pm1.g1.e1 from tbl as "pm1.g1"
and it would be ambiguous with a direct reference to pm1.g1.
Adding support for column aliases with . is not possible at this point.
> Add support for aliases with .
> ------------------------------
>
> Key: TEIID-3439
> URL: https://issues.jboss.org/browse/TEIID-3439
> Project: Teiid
> Issue Type: Feature Request
> Components: Query Engine
> Reporter: Steven Hawkins
> Fix For: 11.0
>
>
> We currently don't allow column or table aliases to contain '.'. This is allowable given a quoted identifier is used. However an early design decision of metamatrix was to relax the rules of naming so that queries against the engine could use quoting (on not) similar to whatever was expected by a given database rather than the engine structure. A lot of resolving and parsing logic will need to change unfortunately to fix this.
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
6 years, 7 months
[JBoss JIRA] (TEIID-5366) SQL string is incorrect with aliased all in group
by Steven Hawkins (JIRA)
Steven Hawkins created TEIID-5366:
-------------------------------------
Summary: SQL string is incorrect with aliased all in group
Key: TEIID-5366
URL: https://issues.jboss.org/browse/TEIID-5366
Project: Teiid
Issue Type: Bug
Components: Query Engine
Reporter: Steven Hawkins
Assignee: Steven Hawkins
Fix For: 11.0, 10.3.2, 10.2.3
SQL such as:
select pm1g2.* from pm1.g1 as pm1g2
After parse/resolve will be shown as the sql string:
SELECT pm1.g1 AS pm1g2.* FROM pm1.g1 AS pm1g2
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
6 years, 7 months