You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@asterixdb.apache.org by "ASF subversion and git services (Jira)" <ji...@apache.org> on 2020/11/14 04:39:00 UTC
[jira] [Commented] (ASTERIXDB-2797) Using an array constructor in a
function results in an internal error
[ https://issues.apache.org/jira/browse/ASTERIXDB-2797?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17231930#comment-17231930 ]
ASF subversion and git services commented on ASTERIXDB-2797:
------------------------------------------------------------
Commit 766d63372729b546def13f45d312623cbfc78b4c in asterixdb's branch refs/heads/master from Ali Alsuliman
[ https://gitbox.apache.org/repos/asf?p=asterixdb.git;h=766d633 ]
[ASTERIXDB-2797][COMP] Fix casting elements of a list constructor
- user model changes: no
- storage format changes: no
- interface changes: no
Details:
Currently, variable elements in a list constructor are always wrapped
in cast() which would cast the variable to open type (when the variable
type is a complex type, e.g. record). The required target type should
be taken into account to decide whether to cast or not.
Change-Id: Id8f2612174d777d1823dc09a3c4d43eae3a9ce68
Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/8864
Integration-Tests: Jenkins <je...@fulliautomatix.ics.uci.edu>
Tested-by: Jenkins <je...@fulliautomatix.ics.uci.edu>
Reviewed-by: Ali Alsuliman <al...@gmail.com>
Reviewed-by: Dmitry Lychagin <dm...@couchbase.com>
> Using an array constructor in a function results in an internal error
> ----------------------------------------------------------------------
>
> Key: ASTERIXDB-2797
> URL: https://issues.apache.org/jira/browse/ASTERIXDB-2797
> Project: Apache AsterixDB
> Issue Type: Bug
> Components: COMP - Compiler
> Affects Versions: 0.9.6
> Reporter: Gift Sinthong
> Assignee: Ali Alsuliman
> Priority: Major
>
>
> The following function (foo) takes in a record and returns it. When calling this function on a dataset (the last query) causes an internal error 'IndexOutOfBounds'. However, calling the same function on a record and an array of records works fine. Changing the array constructor to the 'to_array' function also works.
>
> {code:java}
> USE TinySocial;
> CREATE OR REPLACE FUNCTION foo(r) {
> (SELECT VALUE x FROM [r] AS x)[0]
> };
> foo({'a':5});
> SELECT foo(s) FROM [{'a':5}, {'b':7}] AS s LIMIT 5;
> SELECT foo(s) FROM GleambookUsers AS s LIMIT 5;
> {code}
> Here is the error message from the log file.
> {code:java}
> Caused by: java.lang.IndexOutOfBoundsExceptionCaused by: java.lang.IndexOutOfBoundsException at org.apache.hyracks.data.std.util.ByteArrayAccessibleOutputStream.write(ByteArrayAccessibleOutputStream.java:75) ~[hyracks-data-std-0.3.6-SNAPSHOT.jar:0.3.6-SNAPSHOT] at java.io.DataOutputStream.write(DataOutputStream.java:107) ~[?:1.8.0_121] at org.apache.asterix.om.pointables.ARecordVisitablePointable.set(ARecordVisitablePointable.java:231) ~[asterix-om-0.9.6-SNAPSHOT.jar:0.9.6-SNAPSHOT] at org.apache.asterix.om.pointables.AListVisitablePointable.set(AListVisitablePointable.java:127) ~[asterix-om-0.9.6-SNAPSHOT.jar:0.9.6-SNAPSHOT] at org.apache.asterix.om.pointables.ARecordVisitablePointable.set(ARecordVisitablePointable.java:234) ~[asterix-om-0.9.6-SNAPSHOT.jar:0.9.6-SNAPSHOT] at org.apache.asterix.dataflow.data.nontagged.printers.json.clean.ARecordPrinterFactory$1.print(ARecordPrinterFactory.java:61) ~[asterix-om-0.9.6-SNAPSHOT.jar:0.9.6-SNAPSHOT] at org.apache.hyracks.algebricks.runtime.writers.PrinterBasedWriterFactory$1.printTuple(PrinterBasedWriterFactory.java:66) ~[algebricks-runtime-0.3.6-SNAPSHOT.jar:0.3.6-SNAPSHOT] at org.apache.hyracks.algebricks.runtime.serializer.ResultSerializerFactoryProvider$1$1.appendTuple(ResultSerializerFactoryProvider.java:64) ~[algebricks-runtime-0.3.6-SNAPSHOT.jar:0.3.6-SNAPSHOT] at org.apache.hyracks.dataflow.std.result.ResultWriterOperatorDescriptor$1.nextFrame(ResultWriterOperatorDescriptor.java:105) ~[hyracks-dataflow-std-0.3.6-SNAPSHOT.jar:0.3.6-SNAPSHOT] at org.apache.hyracks.dataflow.common.comm.io.AbstractFrameAppender.write(AbstractFrameAppender.java:94) ~[hyracks-dataflow-common-0.3.6-SNAPSHOT.jar:0.3.6-SNAPSHOT] at org.apache.hyracks.algebricks.runtime.operators.base.AbstractOneInputOneOutputOneFramePushRuntime.flushAndReset(AbstractOneInputOneOutputOneFramePushRuntime.java:73) ~[algebricks-runtime-0.3.6-SNAPSHOT.jar:0.3.6-SNAPSHOT] at org.apache.hyracks.algebricks.runtime.operators.base.AbstractOneInputOneOutputOneFramePushRuntime.flushIfNotFailed(AbstractOneInputOneOutputOneFramePushRuntime.java:78) ~[algebricks-runtime-0.3.6-SNAPSHOT.jar:0.3.6-SNAPSHOT] at org.apache.hyracks.algebricks.runtime.operators.base.AbstractOneInputOneOutputOneFramePushRuntime.close(AbstractOneInputOneOutputOneFramePushRuntime.java:60) ~[algebricks-runtime-0.3.6-SNAPSHOT.jar:0.3.6-SNAPSHOT] ... 7 more
> {code}
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)