You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Vladimir Sitnikov (JIRA)" <ji...@apache.org> on 2015/01/06 16:16:37 UTC
[jira] [Commented] (CALCITE-67) Excception while running a query in
PDI which does a count(*)
[ https://issues.apache.org/jira/browse/CALCITE-67?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14266241#comment-14266241 ]
Vladimir Sitnikov commented on CALCITE-67:
------------------------------------------
The following test passes in Calcite master:
{code:java}
@Test public void testGroupStarSalesEmps() {
CalciteAssert.that()
.with(CalciteAssert.Config.LINGUAL)
.query("select count(*) as c\n"
+ "from sales.emps")
.returnsUnordered(
"C=2");
}{code}
> Excception while running a query in PDI which does a count(*)
> -------------------------------------------------------------
>
> Key: CALCITE-67
> URL: https://issues.apache.org/jira/browse/CALCITE-67
> Project: Calcite
> Issue Type: Bug
> Reporter: GitHub Import
> Labels: github-import
>
> As per optiq-dev. I found if you do select * from emps it works fine, but select count(*) from emps throws this error. Here is the debug output too:
> public static class Record1_0 implements java.io.Serializable {
> public long f0;
> public Record1_0(long f0) {
> this.f0 = f0;
> }
> public boolean equals(Object o) {
> if (this == o) {
> return true;
> }
> if (!(o instanceof Record1_0)) {
> return false;
> }
> return this.f0 == ((Record1_0) o).f0;
> }
> public int hashCode() {
> int h = 0;
> h = net.hydromatic.optiq.runtime.Utilities.hash(h, this.f0);
> return h;
> }
> public int compareTo(Record1_0 that) {
> int c;
> c = net.hydromatic.optiq.runtime.Utilities.compare(this.f0, that.f0);
> if (c != 0) {
> return c;
> }
> return 0;
> }
> public String toString() {
> return "{f0=" + this.f0 + "}";
> }
> }
> public net.hydromatic.linq4j.Enumerable bind(final net.hydromatic.optiq.DataContext root) {
> final net.hydromatic.optiq.impl.csv.CsvTable _inputEnumerable = (net.hydromatic.optiq.impl.csv.CsvTable) ((net.hydromatic.optiq.impl.csv.CsvSchema) root.getRootSchema().getSubSchema("SALES")).getTable("EMPS", java.lang.Object[].class);
> final net.hydromatic.linq4j.AbstractEnumerable child = new net.hydromatic.linq4j.AbstractEnumerable(){
> public net.hydromatic.linq4j.Enumerator enumerator() {
> return new net.hydromatic.linq4j.Enumerator(){
> public final net.hydromatic.linq4j.Enumerator inputEnumerator = _inputEnumerable.enumerator();
> public void reset() {
> inputEnumerator.reset();
> }
> public boolean moveNext() {
> return inputEnumerator.moveNext();
> }
> public void close() {
> inputEnumerator.close();
> }
> public Object current() {
> return 0;
> }
> };
> }
> };
> return net.hydromatic.linq4j.Linq4j.singletonEnumerable(child.aggregate(new net.hydromatic.linq4j.function.Function0() {
> public Object apply() {
> return new Record1_0(
> 0L);
> }
> }
> .apply(), new net.hydromatic.linq4j.function.Function2() {
> public Record1_0 apply(Record1_0 acc, int in) {
> acc.f0 = acc.f0 + 1L;
> return acc;
> }
> public Record1_0 apply(Record1_0 acc, Integer in) {
> return apply(
> acc,
> in.intValue());
> }
> public Record1_0 apply(Object acc, Object in) {
> return apply(
> (Record1_0) acc,
> (Integer) in);
> }
> }
> , new net.hydromatic.linq4j.function.Function1() {
> public long apply(Record1_0 acc) {
> return acc.f0;
> }
> public Object apply(Object acc) {
> return apply(
> (Record1_0) acc);
> }
> }
> ));
> }
> public java.lang.reflect.Type getElementType() {
> return long.class;
> }
> java.lang.AbstractMethodError: Baz$3.apply(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
> at net.hydromatic.linq4j.EnumerableDefaults.aggregate(EnumerableDefaults.java:86)
> at net.hydromatic.linq4j.DefaultEnumerable.aggregate(DefaultEnumerable.java:88)
> at Baz.bind(Baz.java:64)
> at net.hydromatic.optiq.jdbc.OptiqPrepare$PrepareResult.getEnumerable(OptiqPrepare.java:193)
> at net.hydromatic.optiq.jdbc.OptiqPrepare$PrepareResult.enumerator(OptiqPrepare.java:203)
> at net.hydromatic.optiq.jdbc.OptiqStatement$1.apply(OptiqStatement.java:377)
> at net.hydromatic.optiq.jdbc.OptiqStatement$1.apply(OptiqStatement.java:375)
> at net.hydromatic.optiq.jdbc.OptiqResultSet.execute(OptiqResultSet.java:157)
> at net.hydromatic.optiq.jdbc.OptiqStatement.executeQueryInternal(OptiqStatement.java:365)
> at net.hydromatic.optiq.jdbc.OptiqStatement.executeQuery(OptiqStatement.java:80)
> at org.pentaho.di.core.database.Database.openQuery(Database.java:1640)
> at org.pentaho.di.trans.steps.tableinput.TableInput.doQuery(TableInput.java:224)
> at org.pentaho.di.trans.steps.tableinput.TableInput.processRow(TableInput.java:138)
> at org.pentaho.di.trans.step.RunThread.run(RunThread.java:61)
> at java.lang.Thread.run(Thread.java:662)
> ---------------- Imported from GitHub ----------------
> Url: https://github.com/julianhyde/optiq/issues/67
> Created by: [codek|https://github.com/codek]
> Labels:
> Created at: Sat Oct 26 20:55:51 CEST 2013
> State: open
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)