-
Couldn't load subscription status.
- Fork 176
[POC] Make PPL execute successfully on Calcite engine #3258
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,6 +6,7 @@ | |
| package org.opensearch.sql.calcite.plan; | ||
|
|
||
| import java.lang.reflect.Type; | ||
| import org.apache.calcite.adapter.java.AbstractQueryableTable; | ||
| import org.apache.calcite.linq4j.Enumerable; | ||
| import org.apache.calcite.linq4j.QueryProvider; | ||
| import org.apache.calcite.linq4j.Queryable; | ||
|
|
@@ -15,16 +16,17 @@ | |
| import org.apache.calcite.rel.RelNode; | ||
| import org.apache.calcite.rel.type.RelDataType; | ||
| import org.apache.calcite.rel.type.RelDataTypeFactory; | ||
| import org.apache.calcite.schema.QueryableTable; | ||
| import org.apache.calcite.schema.SchemaPlus; | ||
| import org.apache.calcite.schema.Schemas; | ||
| import org.apache.calcite.schema.TranslatableTable; | ||
| import org.apache.calcite.schema.impl.AbstractTable; | ||
| import org.opensearch.sql.calcite.utils.OpenSearchRelDataTypes; | ||
| import org.opensearch.sql.data.model.ExprValue; | ||
|
|
||
| public abstract class OpenSearchTable extends AbstractTable | ||
| implements TranslatableTable, QueryableTable, org.opensearch.sql.storage.Table { | ||
| public abstract class OpenSearchTable extends AbstractQueryableTable | ||
| implements TranslatableTable, org.opensearch.sql.storage.Table { | ||
|
|
||
| protected OpenSearchTable(Type elementType) { | ||
| super(elementType); | ||
| } | ||
|
|
||
| @Override | ||
| public RelDataType getRowType(RelDataTypeFactory relDataTypeFactory) { | ||
|
|
@@ -34,6 +36,8 @@ public RelDataType getRowType(RelDataTypeFactory relDataTypeFactory) { | |
| @Override | ||
| public RelNode toRel(RelOptTable.ToRelContext context, RelOptTable relOptTable) { | ||
| final RelOptCluster cluster = context.getCluster(); | ||
| // return new LogicalTableScan(cluster, cluster.traitSetOf(Convention.NONE), ImmutableList.of(), | ||
| // relOptTable); | ||
| return new OpenSearchTableScan(cluster, relOptTable, this); | ||
| } | ||
|
|
||
|
|
@@ -53,5 +57,5 @@ public Expression getExpression(SchemaPlus schema, String tableName, Class clazz | |
| return Schemas.tableExpression(schema, getElementType(), tableName, clazz); | ||
| } | ||
|
|
||
| public abstract Enumerable<ExprValue> search(); | ||
| public abstract Enumerable<Object> search(); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What's reason to replace There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It will throw exception and says that |
||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.