Skip to content

Commit

Permalink
DRILL-1384: Part 7 - Resolve conflicts after rebasing Drill master wi…
Browse files Browse the repository at this point in the history
…th view/impersonation.
  • Loading branch information
jinfengni committed Apr 22, 2015
1 parent e462d14 commit e99f270
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 8 deletions.
Expand Up @@ -110,7 +110,7 @@ public BufferAllocator getAllocator() {
} }


/** /**
* Return reference to default schema instance in a schema tree. Each {@link net.hydromatic.optiq.SchemaPlus} * Return reference to default schema instance in a schema tree. Each {@link org.apache.calcite.schema.SchemaPlus}
* instance can refer to its parent and its children. From the returned reference to default schema instance, * instance can refer to its parent and its children. From the returned reference to default schema instance,
* clients can traverse the entire schema tree and know the default schema where to look up the tables first. * clients can traverse the entire schema tree and know the default schema where to look up the tables first.
* *
Expand Down Expand Up @@ -153,7 +153,7 @@ public SchemaPlus getRootSchema(String userName) {
*/ */
public SchemaPlus getRootSchema(SchemaConfig schemaConfig) { public SchemaPlus getRootSchema(SchemaConfig schemaConfig) {
try { try {
final SchemaPlus rootSchema = SimpleOptiqSchema.createRootSchema(false); final SchemaPlus rootSchema = SimpleCalciteSchema.createRootSchema(false);
drillbitContext.getSchemaFactory().registerSchemas(schemaConfig, rootSchema); drillbitContext.getSchemaFactory().registerSchemas(schemaConfig, rootSchema);
return rootSchema; return rootSchema;
} catch(IOException e) { } catch(IOException e) {
Expand Down
Expand Up @@ -19,10 +19,10 @@


import com.carrotsearch.hppc.ObjectIntOpenHashMap; import com.carrotsearch.hppc.ObjectIntOpenHashMap;
import com.google.common.base.Preconditions; import com.google.common.base.Preconditions;
import net.hydromatic.optiq.SchemaPlus; import org.apache.calcite.schema.SchemaPlus;
import org.apache.drill.common.exceptions.UserException; import org.apache.drill.common.exceptions.UserException;
import org.eigenbase.relopt.RelOptTable; import org.apache.calcite.plan.RelOptTable;
import org.eigenbase.relopt.RelOptTable.ToRelContext; import org.apache.calcite.plan.RelOptTable.ToRelContext;


import static org.apache.drill.exec.ExecConstants.IMPERSONATION_MAX_CHAINED_USER_HOPS; import static org.apache.drill.exec.ExecConstants.IMPERSONATION_MAX_CHAINED_USER_HOPS;


Expand Down
Expand Up @@ -30,6 +30,7 @@
import org.apache.drill.exec.store.StoragePlugin; import org.apache.drill.exec.store.StoragePlugin;
import org.apache.calcite.rel.RelNode; import org.apache.calcite.rel.RelNode;
import org.apache.calcite.plan.RelOptTable; import org.apache.calcite.plan.RelOptTable;
import org.apache.drill.exec.util.ImpersonationUtil;


public abstract class DrillTable implements Table { public abstract class DrillTable implements Table {


Expand Down
Expand Up @@ -31,6 +31,7 @@
import org.apache.calcite.plan.RelOptUtil; import org.apache.calcite.plan.RelOptUtil;
import org.apache.calcite.rel.type.RelDataType; import org.apache.calcite.rel.type.RelDataType;
import org.apache.calcite.rel.type.RelDataTypeFactory; import org.apache.calcite.rel.type.RelDataTypeFactory;
import org.apache.drill.exec.ops.ViewExpansionContext;


public class DrillViewTable implements TranslatableTable, DrillViewInfoProvider { public class DrillViewTable implements TranslatableTable, DrillViewInfoProvider {
static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(DrillViewTable.class); static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(DrillViewTable.class);
Expand All @@ -57,7 +58,7 @@ public Statistic getStatistic() {


@Override @Override
public RelNode toRel(ToRelContext context, RelOptTable relOptTable) { public RelNode toRel(ToRelContext context, RelOptTable relOptTable) {
ViewExpansionToken token = null; ViewExpansionContext.ViewExpansionToken token = null;
try { try {
RelDataType rowType = relOptTable.getRowType(); RelDataType rowType = relOptTable.getRowType();
RelNode rel; RelNode rel;
Expand Down
Expand Up @@ -64,6 +64,7 @@
import org.apache.calcite.sql.parser.SqlParseException; import org.apache.calcite.sql.parser.SqlParseException;
import org.apache.calcite.sql.parser.SqlParser; import org.apache.calcite.sql.parser.SqlParser;
import org.apache.calcite.sql.parser.SqlParserImplFactory; import org.apache.calcite.sql.parser.SqlParserImplFactory;
import org.apache.hadoop.security.AccessControlException;


public class DrillSqlWorker { public class DrillSqlWorker {
// private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(DrillSqlWorker.class); // private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(DrillSqlWorker.class);
Expand Down
Expand Up @@ -52,6 +52,7 @@
import org.apache.calcite.rel.type.RelDataTypeFactory; import org.apache.calcite.rel.type.RelDataTypeFactory;
import org.apache.calcite.rex.RexBuilder; import org.apache.calcite.rex.RexBuilder;
import org.apache.calcite.rex.RexNode; import org.apache.calcite.rex.RexNode;
import org.apache.calcite.schema.SchemaPlus;


public class ConversionContext implements ToRelContext { public class ConversionContext implements ToRelContext {
static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(ConversionContext.class); static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(ConversionContext.class);
Expand Down
Expand Up @@ -25,6 +25,7 @@
import java.util.Map; import java.util.Map;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;


import com.google.common.collect.ArrayListMultimap;
import org.apache.drill.common.exceptions.DrillRuntimeException; import org.apache.drill.common.exceptions.DrillRuntimeException;
import org.apache.drill.common.exceptions.ExecutionSetupException; import org.apache.drill.common.exceptions.ExecutionSetupException;
import org.apache.drill.common.expression.SchemaPath; import org.apache.drill.common.expression.SchemaPath;
Expand Down Expand Up @@ -156,6 +157,7 @@ public ParquetGroupScan( //
* This is used to clone another copy of the group scan. * This is used to clone another copy of the group scan.
*/ */
private ParquetGroupScan(ParquetGroupScan that) { private ParquetGroupScan(ParquetGroupScan that) {
super(that);
this.columns = that.columns == null ? null : Lists.newArrayList(that.columns); this.columns = that.columns == null ? null : Lists.newArrayList(that.columns);
this.endpointAffinities = that.endpointAffinities == null ? null : Lists.newArrayList(that.endpointAffinities); this.endpointAffinities = that.endpointAffinities == null ? null : Lists.newArrayList(that.endpointAffinities);
this.entries = that.entries == null ? null : Lists.newArrayList(that.entries); this.entries = that.entries == null ? null : Lists.newArrayList(that.entries);
Expand Down
Expand Up @@ -102,7 +102,7 @@ protected void testSqlPlan(String sqlCommands) throws Exception {
registry.init(); registry.init();
final FunctionImplementationRegistry functionRegistry = new FunctionImplementationRegistry(config); final FunctionImplementationRegistry functionRegistry = new FunctionImplementationRegistry(config);
final DrillOperatorTable table = new DrillOperatorTable(functionRegistry); final DrillOperatorTable table = new DrillOperatorTable(functionRegistry);
final SchemaPlus root = SimpleOptiqSchema.createRootSchema(false); final SchemaPlus root = SimpleCalciteSchema.createRootSchema(false);
registry.getSchemaFactory().registerSchemas(SchemaConfig.newBuilder("foo", context).build(), root); registry.getSchemaFactory().registerSchemas(SchemaConfig.newBuilder("foo", context).build(), root);


new NonStrictExpectations() { new NonStrictExpectations() {
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Expand Up @@ -1038,7 +1038,7 @@
<dependency> <dependency>
<groupId>org.apache.calcite</groupId> <groupId>org.apache.calcite</groupId>
<artifactId>calcite-core</artifactId> <artifactId>calcite-core</artifactId>
<version>1.1.0-drill-r1</version> <version>1.1.0-drill-r2</version>
<exclusions> <exclusions>
<exclusion> <exclusion>
<groupId>org.jgrapht</groupId> <groupId>org.jgrapht</groupId>
Expand Down

0 comments on commit e99f270

Please sign in to comment.