├── .gitattributes ├── .gitignore ├── .travis.yml ├── HISTORY.md ├── HOWTO.md ├── INCUBATOR_PROPOSAL.md ├── LICENSE ├── MODEL.md ├── NOTICE ├── README-old.md ├── README.md ├── REFERENCE.md ├── avatica ├── pom.xml └── src │ ├── main │ └── java │ │ └── net │ │ └── hydromatic │ │ └── avatica │ │ ├── ArrayImpl.java │ │ ├── AvaticaConnection.java │ │ ├── AvaticaDatabaseMetaData.java │ │ ├── AvaticaFactory.java │ │ ├── AvaticaJdbc40Factory.java │ │ ├── AvaticaJdbc41Factory.java │ │ ├── AvaticaParameter.java │ │ ├── AvaticaPrepareResult.java │ │ ├── AvaticaPreparedStatement.java │ │ ├── AvaticaResultSet.java │ │ ├── AvaticaResultSetMetaData.java │ │ ├── AvaticaStatement.java │ │ ├── BuiltInConnectionProperty.java │ │ ├── ByteString.java │ │ ├── Casing.java │ │ ├── ColumnMetaData.java │ │ ├── ConnectStringParser.java │ │ ├── ConnectionConfig.java │ │ ├── ConnectionConfigImpl.java │ │ ├── ConnectionProperty.java │ │ ├── Cursor.java │ │ ├── DriverVersion.java │ │ ├── Handler.java │ │ ├── HandlerImpl.java │ │ ├── Helper.java │ │ ├── InternalProperty.java │ │ ├── Meta.java │ │ ├── Quoting.java │ │ ├── UnregisteredDriver.java │ │ └── package-info.java │ └── test │ └── java │ └── net │ └── hydromatic │ └── avatica │ └── test │ ├── AvaticaSuite.java │ ├── ConnectStringParserTest.java │ └── package-info.java ├── core ├── pom.xml └── src │ ├── main │ ├── codegen │ │ ├── config.fmpp │ │ ├── includes │ │ │ └── parserImpls.ftl │ │ └── templates │ │ │ └── CombinedParser.jj │ ├── java │ │ ├── net │ │ │ └── hydromatic │ │ │ │ └── optiq │ │ │ │ ├── AggregateFunction.java │ │ │ │ ├── BuiltinMethod.java │ │ │ │ ├── DataContext.java │ │ │ │ ├── Demo.java │ │ │ │ ├── Function.java │ │ │ │ ├── FunctionParameter.java │ │ │ │ ├── ImplementableAggFunction.java │ │ │ │ ├── ImplementableFunction.java │ │ │ │ ├── Member.java │ │ │ │ ├── ModifiableTable.java │ │ │ │ ├── QueryableTable.java │ │ │ │ ├── ScalarFunction.java │ │ │ │ ├── Schema.java │ │ │ │ ├── SchemaFactory.java │ │ │ │ ├── SchemaPlus.java │ │ │ │ ├── Schemas.java │ │ │ │ ├── SemiMutableSchema.java │ │ │ │ ├── Statistic.java │ │ │ │ ├── Statistics.java │ │ │ │ ├── Table.java │ │ │ │ ├── TableFactory.java │ │ │ │ ├── TableFunction.java │ │ │ │ ├── TableMacro.java │ │ │ │ ├── TranslatableTable.java │ │ │ │ ├── config │ │ │ │ ├── Lex.java │ │ │ │ ├── OptiqConnectionConfig.java │ │ │ │ ├── OptiqConnectionProperty.java │ │ │ │ └── package-info.java │ │ │ │ ├── impl │ │ │ │ ├── AbstractSchema.java │ │ │ │ ├── AbstractTable.java │ │ │ │ ├── AbstractTableQueryable.java │ │ │ │ ├── AggregateFunctionImpl.java │ │ │ │ ├── DelegatingSchema.java │ │ │ │ ├── MaterializedViewTable.java │ │ │ │ ├── ReflectiveFunctionBase.java │ │ │ │ ├── ScalarFunctionImpl.java │ │ │ │ ├── StarTable.java │ │ │ │ ├── TableFunctionImpl.java │ │ │ │ ├── TableMacroImpl.java │ │ │ │ ├── ViewTable.java │ │ │ │ ├── clone │ │ │ │ │ ├── ArrayTable.java │ │ │ │ │ ├── CloneSchema.java │ │ │ │ │ ├── ColumnLoader.java │ │ │ │ │ ├── ListTable.java │ │ │ │ │ └── package-info.java │ │ │ │ ├── java │ │ │ │ │ ├── AbstractQueryableTable.java │ │ │ │ │ ├── JavaTypeFactory.java │ │ │ │ │ ├── ReflectiveSchema.java │ │ │ │ │ └── package-info.java │ │ │ │ ├── jdbc │ │ │ │ │ ├── JdbcConvention.java │ │ │ │ │ ├── JdbcImplementor.java │ │ │ │ │ ├── JdbcQueryProvider.java │ │ │ │ │ ├── JdbcRel.java │ │ │ │ │ ├── JdbcRules.java │ │ │ │ │ ├── JdbcSchema.java │ │ │ │ │ ├── JdbcTable.java │ │ │ │ │ ├── JdbcTableScan.java │ │ │ │ │ ├── JdbcToEnumerableConverter.java │ │ │ │ │ ├── JdbcToEnumerableConverterRule.java │ │ │ │ │ ├── JdbcUtils.java │ │ │ │ │ └── package-info.java │ │ │ │ └── package-info.java │ │ │ │ ├── jdbc │ │ │ │ ├── Driver.java │ │ │ │ ├── JavaRecordType.java │ │ │ │ ├── JavaTypeFactoryImpl.java │ │ │ │ ├── MetaImpl.java │ │ │ │ ├── MetadataSchema.java │ │ │ │ ├── OptiqConnection.java │ │ │ │ ├── OptiqConnectionImpl.java │ │ │ │ ├── OptiqFactory.java │ │ │ │ ├── OptiqJdbc40Factory.java │ │ │ │ ├── OptiqJdbc41Factory.java │ │ │ │ ├── OptiqPrepare.java │ │ │ │ ├── OptiqPreparedStatement.java │ │ │ │ ├── OptiqResultSet.java │ │ │ │ ├── OptiqRootSchema.java │ │ │ │ ├── OptiqSchema.java │ │ │ │ ├── OptiqStatement.java │ │ │ │ ├── SqlTimeoutException.java │ │ │ │ └── package-info.java │ │ │ │ ├── materialize │ │ │ │ ├── MaterializationActor.java │ │ │ │ ├── MaterializationKey.java │ │ │ │ ├── MaterializationService.java │ │ │ │ └── package-info.java │ │ │ │ ├── model │ │ │ │ ├── JsonColumn.java │ │ │ │ ├── JsonCustomSchema.java │ │ │ │ ├── JsonCustomTable.java │ │ │ │ ├── JsonFunction.java │ │ │ │ ├── JsonJdbcSchema.java │ │ │ │ ├── JsonMapSchema.java │ │ │ │ ├── JsonMaterialization.java │ │ │ │ ├── JsonRoot.java │ │ │ │ ├── JsonSchema.java │ │ │ │ ├── JsonTable.java │ │ │ │ ├── JsonView.java │ │ │ │ ├── ModelHandler.java │ │ │ │ └── package-info.java │ │ │ │ ├── package-info.java │ │ │ │ ├── prepare │ │ │ │ ├── LixToRelTranslator.java │ │ │ │ ├── OptiqCatalogReader.java │ │ │ │ ├── OptiqMaterializer.java │ │ │ │ ├── OptiqPrepareImpl.java │ │ │ │ ├── OptiqSqlValidator.java │ │ │ │ ├── PlannerImpl.java │ │ │ │ ├── Prepare.java │ │ │ │ ├── QueryableRelBuilder.java │ │ │ │ ├── RelOptTableImpl.java │ │ │ │ └── package-info.java │ │ │ │ ├── rules │ │ │ │ ├── java │ │ │ │ │ ├── AggAddContext.java │ │ │ │ │ ├── AggContext.java │ │ │ │ │ ├── AggImpState.java │ │ │ │ │ ├── AggImplementor.java │ │ │ │ │ ├── AggResetContext.java │ │ │ │ │ ├── AggResultContext.java │ │ │ │ │ ├── CallImplementor.java │ │ │ │ │ ├── EnumerableConvention.java │ │ │ │ │ ├── EnumerableRel.java │ │ │ │ │ ├── EnumerableRelImplementor.java │ │ │ │ │ ├── JavaRelImplementor.java │ │ │ │ │ ├── JavaRowFormat.java │ │ │ │ │ ├── JavaRules.java │ │ │ │ │ ├── NestedBlockBuilder.java │ │ │ │ │ ├── NestedBlockBuilderImpl.java │ │ │ │ │ ├── NotNullImplementor.java │ │ │ │ │ ├── NullPolicy.java │ │ │ │ │ ├── PhysType.java │ │ │ │ │ ├── PhysTypeImpl.java │ │ │ │ │ ├── ReflectiveCallNotNullImplementor.java │ │ │ │ │ ├── RexImpTable.java │ │ │ │ │ ├── RexToLixTranslator.java │ │ │ │ │ ├── StrictAggImplementor.java │ │ │ │ │ ├── StrictWinAggImplementor.java │ │ │ │ │ ├── WinAggAddContext.java │ │ │ │ │ ├── WinAggContext.java │ │ │ │ │ ├── WinAggFrameContext.java │ │ │ │ │ ├── WinAggFrameResultContext.java │ │ │ │ │ ├── WinAggImplementor.java │ │ │ │ │ ├── WinAggResetContext.java │ │ │ │ │ ├── WinAggResultContext.java │ │ │ │ │ ├── impl │ │ │ │ │ │ ├── AggAddContextImpl.java │ │ │ │ │ │ ├── AggResetContextImpl.java │ │ │ │ │ │ ├── AggResultContextImpl.java │ │ │ │ │ │ ├── WinAggAddContextImpl.java │ │ │ │ │ │ ├── WinAggResetContextImpl.java │ │ │ │ │ │ ├── WinAggResultContextImpl.java │ │ │ │ │ │ └── package-info.java │ │ │ │ │ └── package-info.java │ │ │ │ └── package-info.java │ │ │ │ ├── runtime │ │ │ │ ├── AbstractCursor.java │ │ │ │ ├── ArrayComparator.java │ │ │ │ ├── ArrayEnumeratorCursor.java │ │ │ │ ├── BinarySearch.java │ │ │ │ ├── Bindable.java │ │ │ │ ├── EnumeratorCursor.java │ │ │ │ ├── FlatLists.java │ │ │ │ ├── Hook.java │ │ │ │ ├── Like.java │ │ │ │ ├── ObjectEnumeratorCursor.java │ │ │ │ ├── RecordEnumeratorCursor.java │ │ │ │ ├── ResultSetEnumerable.java │ │ │ │ ├── SortedMultiMap.java │ │ │ │ ├── Spacer.java │ │ │ │ ├── Spaces.java │ │ │ │ ├── SqlFunctions.java │ │ │ │ ├── Typed.java │ │ │ │ ├── Unit.java │ │ │ │ ├── Utilities.java │ │ │ │ └── package-info.java │ │ │ │ ├── server │ │ │ │ ├── OptiqServer.java │ │ │ │ ├── OptiqServerStatement.java │ │ │ │ └── package-info.java │ │ │ │ ├── tools │ │ │ │ ├── Frameworks.java │ │ │ │ ├── Planner.java │ │ │ │ ├── Program.java │ │ │ │ ├── Programs.java │ │ │ │ ├── RelConversionException.java │ │ │ │ ├── RuleSet.java │ │ │ │ ├── RuleSets.java │ │ │ │ ├── SqlRun.java │ │ │ │ ├── ValidationException.java │ │ │ │ └── package-info.java │ │ │ │ └── util │ │ │ │ ├── BitSets.java │ │ │ │ ├── Compatible.java │ │ │ │ ├── CompatibleGuava11.java │ │ │ │ ├── CompositeMap.java │ │ │ │ ├── PartiallyOrderedSet.java │ │ │ │ ├── graph │ │ │ │ ├── BreadthFirstIterator.java │ │ │ │ ├── CycleDetector.java │ │ │ │ ├── DefaultDirectedGraph.java │ │ │ │ ├── DefaultEdge.java │ │ │ │ ├── DepthFirstIterator.java │ │ │ │ ├── DirectedGraph.java │ │ │ │ ├── Graphs.java │ │ │ │ ├── TopologicalOrderIterator.java │ │ │ │ └── package-info.java │ │ │ │ └── package-info.java │ │ └── org │ │ │ └── eigenbase │ │ │ ├── javac │ │ │ ├── JaninoCompiler.java │ │ │ ├── JavaCompiler.java │ │ │ ├── JavaCompilerArgs.java │ │ │ ├── SynchronizedJaninoCompiler.java │ │ │ └── package-info.java │ │ │ ├── jdbc4 │ │ │ └── package-info.java │ │ │ ├── rel │ │ │ ├── AbstractRelNode.java │ │ │ ├── AggregateCall.java │ │ │ ├── AggregateRel.java │ │ │ ├── AggregateRelBase.java │ │ │ ├── Aggregation.java │ │ │ ├── CalcRel.java │ │ │ ├── CalcRelBase.java │ │ │ ├── CollectRel.java │ │ │ ├── CorrelatorRel.java │ │ │ ├── EmptyRel.java │ │ │ ├── FilterRel.java │ │ │ ├── FilterRelBase.java │ │ │ ├── IntersectRel.java │ │ │ ├── IntersectRelBase.java │ │ │ ├── InvalidRelException.java │ │ │ ├── JoinRel.java │ │ │ ├── JoinRelBase.java │ │ │ ├── JoinRelType.java │ │ │ ├── MinusRel.java │ │ │ ├── MinusRelBase.java │ │ │ ├── OneRowRel.java │ │ │ ├── OneRowRelBase.java │ │ │ ├── ProjectRel.java │ │ │ ├── ProjectRelBase.java │ │ │ ├── RelCollation.java │ │ │ ├── RelCollationImpl.java │ │ │ ├── RelCollationTraitDef.java │ │ │ ├── RelFactories.java │ │ │ ├── RelFieldCollation.java │ │ │ ├── RelImplementorImpl.java │ │ │ ├── RelInput.java │ │ │ ├── RelJson.java │ │ │ ├── RelJsonReader.java │ │ │ ├── RelJsonWriter.java │ │ │ ├── RelNode.java │ │ │ ├── RelShuttle.java │ │ │ ├── RelShuttleImpl.java │ │ │ ├── RelVisitor.java │ │ │ ├── RelWriter.java │ │ │ ├── RelWriterImpl.java │ │ │ ├── RelXmlWriter.java │ │ │ ├── SamplingRel.java │ │ │ ├── SetOpRel.java │ │ │ ├── SingleRel.java │ │ │ ├── SortRel.java │ │ │ ├── TableAccessRel.java │ │ │ ├── TableAccessRelBase.java │ │ │ ├── TableFunctionRel.java │ │ │ ├── TableFunctionRelBase.java │ │ │ ├── TableModificationRel.java │ │ │ ├── TableModificationRelBase.java │ │ │ ├── UncollectRel.java │ │ │ ├── UnionRel.java │ │ │ ├── UnionRelBase.java │ │ │ ├── ValuesRel.java │ │ │ ├── ValuesRelBase.java │ │ │ ├── WindowRel.java │ │ │ ├── WindowRelBase.java │ │ │ ├── convert │ │ │ │ ├── ConverterRel.java │ │ │ │ ├── ConverterRelImpl.java │ │ │ │ ├── ConverterRule.java │ │ │ │ ├── NoneConverterRel.java │ │ │ │ ├── TraitMatchingRule.java │ │ │ │ └── package-info.java │ │ │ ├── jdbc │ │ │ │ └── package-info.java │ │ │ ├── metadata │ │ │ │ ├── BuiltInMetadata.java │ │ │ │ ├── CachingRelMetadataProvider.java │ │ │ │ ├── ChainedRelMetadataProvider.java │ │ │ │ ├── DefaultRelMetadataProvider.java │ │ │ │ ├── Metadata.java │ │ │ │ ├── MetadataFactory.java │ │ │ │ ├── MetadataFactoryImpl.java │ │ │ │ ├── ReflectiveRelMetadataProvider.java │ │ │ │ ├── RelColumnMapping.java │ │ │ │ ├── RelColumnOrigin.java │ │ │ │ ├── RelMdColumnOrigins.java │ │ │ │ ├── RelMdColumnUniqueness.java │ │ │ │ ├── RelMdDistinctRowCount.java │ │ │ │ ├── RelMdExplainVisibility.java │ │ │ │ ├── RelMdPercentageOriginalRows.java │ │ │ │ ├── RelMdPopulationSize.java │ │ │ │ ├── RelMdRowCount.java │ │ │ │ ├── RelMdSelectivity.java │ │ │ │ ├── RelMdUniqueKeys.java │ │ │ │ ├── RelMdUtil.java │ │ │ │ ├── RelMetadataProvider.java │ │ │ │ ├── RelMetadataQuery.java │ │ │ │ └── package-info.java │ │ │ ├── package-info.java │ │ │ └── rules │ │ │ │ ├── AddRedundantSemiJoinRule.java │ │ │ │ ├── CalcRelSplitter.java │ │ │ │ ├── CoerceInputsRule.java │ │ │ │ ├── CombineUnionsRule.java │ │ │ │ ├── ConvertMultiJoinRule.java │ │ │ │ ├── ExtractJoinFilterRule.java │ │ │ │ ├── FilterToCalcRule.java │ │ │ │ ├── LoptJoinTree.java │ │ │ │ ├── LoptMultiJoin.java │ │ │ │ ├── LoptOptimizeJoinRule.java │ │ │ │ ├── LoptSemiJoinOptimizer.java │ │ │ │ ├── MergeCalcRule.java │ │ │ │ ├── MergeFilterOntoCalcRule.java │ │ │ │ ├── MergeFilterRule.java │ │ │ │ ├── MergeProjectOntoCalcRule.java │ │ │ │ ├── MergeProjectRule.java │ │ │ │ ├── MultiJoinRel.java │ │ │ │ ├── NestedLoopsJoinRule.java │ │ │ │ ├── ProjectToCalcRule.java │ │ │ │ ├── PullConstantsThroughAggregatesRule.java │ │ │ │ ├── PullUpAggregateAboveUnionRule.java │ │ │ │ ├── PullUpProjectsAboveJoinRule.java │ │ │ │ ├── PullUpProjectsOnTopOfMultiJoinRule.java │ │ │ │ ├── PushAggregateThroughUnionRule.java │ │ │ │ ├── PushFilterIntoMultiJoinRule.java │ │ │ │ ├── PushFilterPastJoinRule.java │ │ │ │ ├── PushFilterPastProjectRule.java │ │ │ │ ├── PushFilterPastSetOpRule.java │ │ │ │ ├── PushFilterPastTableFunctionRule.java │ │ │ │ ├── PushJoinThroughJoinRule.java │ │ │ │ ├── PushJoinThroughUnionRule.java │ │ │ │ ├── PushProjectIntoMultiJoinRule.java │ │ │ │ ├── PushProjectPastFilterRule.java │ │ │ │ ├── PushProjectPastJoinRule.java │ │ │ │ ├── PushProjectPastSetOpRule.java │ │ │ │ ├── PushProjectPastSortRule.java │ │ │ │ ├── PushProjector.java │ │ │ │ ├── PushSemiJoinPastFilterRule.java │ │ │ │ ├── PushSemiJoinPastJoinRule.java │ │ │ │ ├── PushSemiJoinPastProjectRule.java │ │ │ │ ├── PushSortPastProjectRule.java │ │ │ │ ├── ReduceAggregatesRule.java │ │ │ │ ├── ReduceDecimalsRule.java │ │ │ │ ├── ReduceExpressionsRule.java │ │ │ │ ├── ReduceValuesRule.java │ │ │ │ ├── RemoveDistinctAggregateRule.java │ │ │ │ ├── RemoveDistinctRule.java │ │ │ │ ├── RemoveEmptyRules.java │ │ │ │ ├── RemoveIsNotDistinctFromRule.java │ │ │ │ ├── RemoveSemiJoinRule.java │ │ │ │ ├── RemoveSortRule.java │ │ │ │ ├── RemoveTrivialCalcRule.java │ │ │ │ ├── RemoveTrivialProjectRule.java │ │ │ │ ├── SemiJoinRel.java │ │ │ │ ├── SwapJoinRule.java │ │ │ │ ├── TableAccessRule.java │ │ │ │ ├── UnionEliminatorRule.java │ │ │ │ ├── UnionToDistinctRule.java │ │ │ │ ├── WindowedAggSplitterRule.java │ │ │ │ └── package-info.java │ │ │ ├── relopt │ │ │ ├── AbstractRelOptPlanner.java │ │ │ ├── CommonRelSubExprRule.java │ │ │ ├── Convention.java │ │ │ ├── ConventionTraitDef.java │ │ │ ├── MulticastRelOptListener.java │ │ │ ├── RelImplementor.java │ │ │ ├── RelOptAbstractTable.java │ │ │ ├── RelOptCluster.java │ │ │ ├── RelOptConnection.java │ │ │ ├── RelOptCost.java │ │ │ ├── RelOptCostFactory.java │ │ │ ├── RelOptCostImpl.java │ │ │ ├── RelOptListener.java │ │ │ ├── RelOptMaterialization.java │ │ │ ├── RelOptNode.java │ │ │ ├── RelOptPlanner.java │ │ │ ├── RelOptQuery.java │ │ │ ├── RelOptRule.java │ │ │ ├── RelOptRuleCall.java │ │ │ ├── RelOptRuleOperand.java │ │ │ ├── RelOptRuleOperandChildPolicy.java │ │ │ ├── RelOptRuleOperandChildren.java │ │ │ ├── RelOptSamplingParameters.java │ │ │ ├── RelOptSchema.java │ │ │ ├── RelOptSchemaWithSampling.java │ │ │ ├── RelOptTable.java │ │ │ ├── RelOptUtil.java │ │ │ ├── RelTrait.java │ │ │ ├── RelTraitDef.java │ │ │ ├── RelTraitPropagationVisitor.java │ │ │ ├── RelTraitSet.java │ │ │ ├── SubstitutionVisitor.java │ │ │ ├── TableAccessMap.java │ │ │ ├── VisitorRelVisitor.java │ │ │ ├── hep │ │ │ │ ├── HepInstruction.java │ │ │ │ ├── HepMatchOrder.java │ │ │ │ ├── HepPlanner.java │ │ │ │ ├── HepProgram.java │ │ │ │ ├── HepProgramBuilder.java │ │ │ │ ├── HepRelMetadataProvider.java │ │ │ │ ├── HepRelVertex.java │ │ │ │ ├── HepRuleCall.java │ │ │ │ └── package-info.java │ │ │ ├── package-info.java │ │ │ └── volcano │ │ │ │ ├── AbstractConverter.java │ │ │ │ ├── ChainedPhaseRuleMappingInitializer.java │ │ │ │ ├── RelSet.java │ │ │ │ ├── RelSubset.java │ │ │ │ ├── RuleQueue.java │ │ │ │ ├── VolcanoCost.java │ │ │ │ ├── VolcanoPlanner.java │ │ │ │ ├── VolcanoPlannerPhase.java │ │ │ │ ├── VolcanoPlannerPhaseRuleMappingInitializer.java │ │ │ │ ├── VolcanoRelMetadataProvider.java │ │ │ │ ├── VolcanoRuleCall.java │ │ │ │ ├── VolcanoRuleMatch.java │ │ │ │ └── package-info.java │ │ │ ├── reltype │ │ │ ├── RelCrossType.java │ │ │ ├── RelDataType.java │ │ │ ├── RelDataTypeComparability.java │ │ │ ├── RelDataTypeFactory.java │ │ │ ├── RelDataTypeFactoryImpl.java │ │ │ ├── RelDataTypeFamily.java │ │ │ ├── RelDataTypeField.java │ │ │ ├── RelDataTypeFieldImpl.java │ │ │ ├── RelDataTypeImpl.java │ │ │ ├── RelDataTypePrecedenceList.java │ │ │ ├── RelProtoDataType.java │ │ │ ├── RelRecordType.java │ │ │ └── package-info.java │ │ │ ├── resource │ │ │ ├── EigenbaseNewResource.java │ │ │ ├── Feature.java │ │ │ └── package-info.java │ │ │ ├── rex │ │ │ ├── RexAction.java │ │ │ ├── RexBuilder.java │ │ │ ├── RexCall.java │ │ │ ├── RexCallBinding.java │ │ │ ├── RexChecker.java │ │ │ ├── RexCopier.java │ │ │ ├── RexCorrelVariable.java │ │ │ ├── RexDynamicParam.java │ │ │ ├── RexExecutable.java │ │ │ ├── RexExecutorImpl.java │ │ │ ├── RexFieldAccess.java │ │ │ ├── RexFieldCollation.java │ │ │ ├── RexInputRef.java │ │ │ ├── RexLiteral.java │ │ │ ├── RexLocalRef.java │ │ │ ├── RexMultisetUtil.java │ │ │ ├── RexNode.java │ │ │ ├── RexOver.java │ │ │ ├── RexPattern.java │ │ │ ├── RexPermutationShuttle.java │ │ │ ├── RexPermuteInputsShuttle.java │ │ │ ├── RexProgram.java │ │ │ ├── RexProgramBuilder.java │ │ │ ├── RexRangeRef.java │ │ │ ├── RexShuttle.java │ │ │ ├── RexSlot.java │ │ │ ├── RexSqlConvertlet.java │ │ │ ├── RexSqlConvertletTable.java │ │ │ ├── RexSqlReflectiveConvertletTable.java │ │ │ ├── RexSqlStandardConvertletTable.java │ │ │ ├── RexToSqlNodeConverter.java │ │ │ ├── RexToSqlNodeConverterImpl.java │ │ │ ├── RexTransformer.java │ │ │ ├── RexUtil.java │ │ │ ├── RexVariable.java │ │ │ ├── RexVisitor.java │ │ │ ├── RexVisitorImpl.java │ │ │ ├── RexWindow.java │ │ │ ├── RexWindowBound.java │ │ │ └── package-info.java │ │ │ ├── runtime │ │ │ └── package-info.java │ │ │ ├── sarg │ │ │ ├── SargBinding.java │ │ │ ├── SargBoundType.java │ │ │ ├── SargEndpoint.java │ │ │ ├── SargExpr.java │ │ │ ├── SargFactory.java │ │ │ ├── SargInterval.java │ │ │ ├── SargIntervalBase.java │ │ │ ├── SargIntervalExpr.java │ │ │ ├── SargIntervalSequence.java │ │ │ ├── SargMutableEndpoint.java │ │ │ ├── SargRexAnalyzer.java │ │ │ ├── SargSetExpr.java │ │ │ ├── SargSetOperator.java │ │ │ ├── SargStrictness.java │ │ │ └── package-info.java │ │ │ ├── sql │ │ │ ├── ExplicitOperatorBinding.java │ │ │ ├── JoinConditionType.java │ │ │ ├── JoinType.java │ │ │ ├── SqlAbstractDateTimeLiteral.java │ │ │ ├── SqlAbstractStringLiteral.java │ │ │ ├── SqlAccessEnum.java │ │ │ ├── SqlAccessType.java │ │ │ ├── SqlAggFunction.java │ │ │ ├── SqlAsOperator.java │ │ │ ├── SqlBasicCall.java │ │ │ ├── SqlBinaryOperator.java │ │ │ ├── SqlBinaryStringLiteral.java │ │ │ ├── SqlCall.java │ │ │ ├── SqlCallBinding.java │ │ │ ├── SqlCharStringLiteral.java │ │ │ ├── SqlCollation.java │ │ │ ├── SqlDataTypeSpec.java │ │ │ ├── SqlDateLiteral.java │ │ │ ├── SqlDelete.java │ │ │ ├── SqlDialect.java │ │ │ ├── SqlDynamicParam.java │ │ │ ├── SqlExplain.java │ │ │ ├── SqlExplainLevel.java │ │ │ ├── SqlFunction.java │ │ │ ├── SqlFunctionCategory.java │ │ │ ├── SqlFunctionalOperator.java │ │ │ ├── SqlIdentifier.java │ │ │ ├── SqlInfixOperator.java │ │ │ ├── SqlInsert.java │ │ │ ├── SqlInsertKeyword.java │ │ │ ├── SqlInternalOperator.java │ │ │ ├── SqlIntervalLiteral.java │ │ │ ├── SqlIntervalQualifier.java │ │ │ ├── SqlJdbcFunctionCall.java │ │ │ ├── SqlJoin.java │ │ │ ├── SqlKind.java │ │ │ ├── SqlLiteral.java │ │ │ ├── SqlMerge.java │ │ │ ├── SqlNode.java │ │ │ ├── SqlNodeList.java │ │ │ ├── SqlNullSemantics.java │ │ │ ├── SqlNumericLiteral.java │ │ │ ├── SqlOperandCountRange.java │ │ │ ├── SqlOperator.java │ │ │ ├── SqlOperatorBinding.java │ │ │ ├── SqlOperatorTable.java │ │ │ ├── SqlOrderBy.java │ │ │ ├── SqlOverOperator.java │ │ │ ├── SqlPostfixOperator.java │ │ │ ├── SqlPrefixOperator.java │ │ │ ├── SqlProcedureCallOperator.java │ │ │ ├── SqlRankFunction.java │ │ │ ├── SqlSampleSpec.java │ │ │ ├── SqlSelect.java │ │ │ ├── SqlSelectKeyword.java │ │ │ ├── SqlSelectOperator.java │ │ │ ├── SqlSetOperator.java │ │ │ ├── SqlSetOption.java │ │ │ ├── SqlSpecialOperator.java │ │ │ ├── SqlStateCodes.java │ │ │ ├── SqlSyntax.java │ │ │ ├── SqlTimeLiteral.java │ │ │ ├── SqlTimestampLiteral.java │ │ │ ├── SqlUnnestOperator.java │ │ │ ├── SqlUnresolvedFunction.java │ │ │ ├── SqlUpdate.java │ │ │ ├── SqlUtil.java │ │ │ ├── SqlValuesOperator.java │ │ │ ├── SqlWindow.java │ │ │ ├── SqlWith.java │ │ │ ├── SqlWithItem.java │ │ │ ├── SqlWriter.java │ │ │ ├── advise │ │ │ │ ├── SqlAdvisor.java │ │ │ │ ├── SqlAdvisorGetHintsFunction.java │ │ │ │ ├── SqlAdvisorHint.java │ │ │ │ ├── SqlAdvisorValidator.java │ │ │ │ ├── SqlSimpleParser.java │ │ │ │ └── package-info.java │ │ │ ├── fun │ │ │ │ ├── SqlAbstractTimeFunction.java │ │ │ │ ├── SqlArrayQueryConstructor.java │ │ │ │ ├── SqlArrayValueConstructor.java │ │ │ │ ├── SqlAvgAggFunction.java │ │ │ │ ├── SqlBetweenOperator.java │ │ │ │ ├── SqlCase.java │ │ │ │ ├── SqlCaseOperator.java │ │ │ │ ├── SqlCastFunction.java │ │ │ │ ├── SqlCeilFunction.java │ │ │ │ ├── SqlCoalesceFunction.java │ │ │ │ ├── SqlCollectionTableOperator.java │ │ │ │ ├── SqlColumnListConstructor.java │ │ │ │ ├── SqlConvertFunction.java │ │ │ │ ├── SqlCountAggFunction.java │ │ │ │ ├── SqlCurrentDateFunction.java │ │ │ │ ├── SqlCursorConstructor.java │ │ │ │ ├── SqlDatetimeSubtractionOperator.java │ │ │ │ ├── SqlExtractFunction.java │ │ │ │ ├── SqlFirstLastValueAggFunction.java │ │ │ │ ├── SqlFloorFunction.java │ │ │ │ ├── SqlHistogramAggFunction.java │ │ │ │ ├── SqlInOperator.java │ │ │ │ ├── SqlItemOperator.java │ │ │ │ ├── SqlLeadLagAggFunction.java │ │ │ │ ├── SqlLikeOperator.java │ │ │ │ ├── SqlLiteralChainOperator.java │ │ │ │ ├── SqlMapQueryConstructor.java │ │ │ │ ├── SqlMapValueConstructor.java │ │ │ │ ├── SqlMinMaxAggFunction.java │ │ │ │ ├── SqlMonotonicBinaryOperator.java │ │ │ │ ├── SqlMonotonicUnaryFunction.java │ │ │ │ ├── SqlMultisetMemberOfOperator.java │ │ │ │ ├── SqlMultisetQueryConstructor.java │ │ │ │ ├── SqlMultisetSetOperator.java │ │ │ │ ├── SqlMultisetValueConstructor.java │ │ │ │ ├── SqlNewOperator.java │ │ │ │ ├── SqlNtileAggFunction.java │ │ │ │ ├── SqlNullifFunction.java │ │ │ │ ├── SqlOverlapsOperator.java │ │ │ │ ├── SqlOverlayFunction.java │ │ │ │ ├── SqlPositionFunction.java │ │ │ │ ├── SqlRowOperator.java │ │ │ │ ├── SqlSingleValueAggFunction.java │ │ │ │ ├── SqlStdOperatorTable.java │ │ │ │ ├── SqlStringContextVariable.java │ │ │ │ ├── SqlSubstringFunction.java │ │ │ │ ├── SqlSumAggFunction.java │ │ │ │ ├── SqlSumEmptyIsZeroAggFunction.java │ │ │ │ ├── SqlThrowOperator.java │ │ │ │ ├── SqlTrimFunction.java │ │ │ │ └── package-info.java │ │ │ ├── package-info.java │ │ │ ├── parser │ │ │ │ ├── CommonParser.jj │ │ │ │ ├── Parser.jj │ │ │ │ ├── SqlAbstractParserImpl.java │ │ │ │ ├── SqlParseException.java │ │ │ │ ├── SqlParser.java │ │ │ │ ├── SqlParserImplFactory.java │ │ │ │ ├── SqlParserPos.java │ │ │ │ ├── SqlParserUtil.java │ │ │ │ ├── impl │ │ │ │ │ └── package-info.java │ │ │ │ └── package-info.java │ │ │ ├── pretty │ │ │ │ ├── SqlFormatOptions.java │ │ │ │ ├── SqlPrettyWriter.java │ │ │ │ └── package-info.java │ │ │ ├── type │ │ │ │ ├── AbstractSqlType.java │ │ │ │ ├── ArraySqlType.java │ │ │ │ ├── AssignableOperandTypeChecker.java │ │ │ │ ├── BasicSqlType.java │ │ │ │ ├── ComparableOperandTypeChecker.java │ │ │ │ ├── CompositeOperandTypeChecker.java │ │ │ │ ├── CursorReturnTypeInference.java │ │ │ │ ├── ExplicitOperandTypeInference.java │ │ │ │ ├── ExplicitReturnTypeInference.java │ │ │ │ ├── ExtraSqlTypes.java │ │ │ │ ├── FamilyOperandTypeChecker.java │ │ │ │ ├── InferTypes.java │ │ │ │ ├── IntervalSqlType.java │ │ │ │ ├── JavaToSqlTypeConversionRules.java │ │ │ │ ├── LiteralOperandTypeChecker.java │ │ │ │ ├── MapSqlType.java │ │ │ │ ├── MatchReturnTypeInference.java │ │ │ │ ├── MultisetOperandTypeChecker.java │ │ │ │ ├── MultisetSqlType.java │ │ │ │ ├── ObjectSqlType.java │ │ │ │ ├── OperandTypes.java │ │ │ │ ├── OperandsTypeChecking.java │ │ │ │ ├── OrdinalReturnTypeInference.java │ │ │ │ ├── ReturnTypes.java │ │ │ │ ├── SameOperandTypeChecker.java │ │ │ │ ├── SetopOperandTypeChecker.java │ │ │ │ ├── SqlOperandCountRanges.java │ │ │ │ ├── SqlOperandTypeChecker.java │ │ │ │ ├── SqlOperandTypeInference.java │ │ │ │ ├── SqlReturnTypeInference.java │ │ │ │ ├── SqlReturnTypeInferenceChain.java │ │ │ │ ├── SqlSingleOperandTypeChecker.java │ │ │ │ ├── SqlTypeAssignmentRules.java │ │ │ │ ├── SqlTypeExplicitPrecedenceList.java │ │ │ │ ├── SqlTypeFactoryImpl.java │ │ │ │ ├── SqlTypeFamily.java │ │ │ │ ├── SqlTypeName.java │ │ │ │ ├── SqlTypeTransform.java │ │ │ │ ├── SqlTypeTransformCascade.java │ │ │ │ ├── SqlTypeTransforms.java │ │ │ │ ├── SqlTypeUtil.java │ │ │ │ ├── TableFunctionReturnTypeInference.java │ │ │ │ └── package-info.java │ │ │ ├── util │ │ │ │ ├── ChainedSqlOperatorTable.java │ │ │ │ ├── ListSqlOperatorTable.java │ │ │ │ ├── ReflectiveSqlOperatorTable.java │ │ │ │ ├── SqlBasicVisitor.java │ │ │ │ ├── SqlBuilder.java │ │ │ │ ├── SqlShuttle.java │ │ │ │ ├── SqlString.java │ │ │ │ ├── SqlVisitor.java │ │ │ │ └── package-info.java │ │ │ └── validate │ │ │ │ ├── AbstractNamespace.java │ │ │ │ ├── AggChecker.java │ │ │ │ ├── AggFinder.java │ │ │ │ ├── AggregatingScope.java │ │ │ │ ├── AggregatingSelectScope.java │ │ │ │ ├── AliasNamespace.java │ │ │ │ ├── CollectNamespace.java │ │ │ │ ├── CollectScope.java │ │ │ │ ├── DelegatingNamespace.java │ │ │ │ ├── DelegatingScope.java │ │ │ │ ├── DelegatingSqlValidatorCatalogReader.java │ │ │ │ ├── DelegatingSqlValidatorTable.java │ │ │ │ ├── EmptyScope.java │ │ │ │ ├── FieldNamespace.java │ │ │ │ ├── IdentifierNamespace.java │ │ │ │ ├── JoinNamespace.java │ │ │ │ ├── JoinScope.java │ │ │ │ ├── ListScope.java │ │ │ │ ├── OrderByScope.java │ │ │ │ ├── OverScope.java │ │ │ │ ├── ParameterNamespace.java │ │ │ │ ├── ParameterScope.java │ │ │ │ ├── ProcedureNamespace.java │ │ │ │ ├── SelectNamespace.java │ │ │ │ ├── SelectScope.java │ │ │ │ ├── SetopNamespace.java │ │ │ │ ├── SqlConformance.java │ │ │ │ ├── SqlIdentifierMoniker.java │ │ │ │ ├── SqlMoniker.java │ │ │ │ ├── SqlMonikerComparator.java │ │ │ │ ├── SqlMonikerImpl.java │ │ │ │ ├── SqlMonikerType.java │ │ │ │ ├── SqlMonotonicity.java │ │ │ │ ├── SqlScopedShuttle.java │ │ │ │ ├── SqlUserDefinedAggFunction.java │ │ │ │ ├── SqlUserDefinedFunction.java │ │ │ │ ├── SqlUserDefinedTableFunction.java │ │ │ │ ├── SqlUserDefinedTableMacro.java │ │ │ │ ├── SqlValidator.java │ │ │ │ ├── SqlValidatorCatalogReader.java │ │ │ │ ├── SqlValidatorException.java │ │ │ │ ├── SqlValidatorImpl.java │ │ │ │ ├── SqlValidatorNamespace.java │ │ │ │ ├── SqlValidatorScope.java │ │ │ │ ├── SqlValidatorTable.java │ │ │ │ ├── SqlValidatorUtil.java │ │ │ │ ├── SqlValidatorWithHints.java │ │ │ │ ├── TableConstructorNamespace.java │ │ │ │ ├── TableNamespace.java │ │ │ │ ├── UnnestNamespace.java │ │ │ │ ├── WithItemNamespace.java │ │ │ │ ├── WithNamespace.java │ │ │ │ ├── WithScope.java │ │ │ │ └── package-info.java │ │ │ ├── sql2rel │ │ │ ├── DefaultValueFactory.java │ │ │ ├── ReflectiveConvertletTable.java │ │ │ ├── RelDecorrelator.java │ │ │ ├── RelFieldTrimmer.java │ │ │ ├── RelStructuredTypeFlattener.java │ │ │ ├── SqlNodeToRexConverter.java │ │ │ ├── SqlNodeToRexConverterImpl.java │ │ │ ├── SqlRexContext.java │ │ │ ├── SqlRexConvertlet.java │ │ │ ├── SqlRexConvertletTable.java │ │ │ ├── SqlToRelConverter.java │ │ │ ├── StandardConvertletTable.java │ │ │ ├── SubqueryConverter.java │ │ │ └── package-info.java │ │ │ ├── stat │ │ │ ├── RelStatColumnStatistics.java │ │ │ ├── RelStatSource.java │ │ │ └── package-info.java │ │ │ ├── trace │ │ │ ├── EigenbaseLogger.java │ │ │ ├── EigenbaseTimingTracer.java │ │ │ ├── EigenbaseTrace.java │ │ │ └── package-info.java │ │ │ ├── util │ │ │ ├── BarfingInvocationHandler.java │ │ │ ├── Benchmark.java │ │ │ ├── BitString.java │ │ │ ├── Bug.java │ │ │ ├── CancelFlag.java │ │ │ ├── CastingList.java │ │ │ ├── ChunkList.java │ │ │ ├── ClosableAllocation.java │ │ │ ├── ClosableAllocationOwner.java │ │ │ ├── CompositeList.java │ │ │ ├── CompoundClosableAllocation.java │ │ │ ├── ControlFlowException.java │ │ │ ├── DelegatingInvocationHandler.java │ │ │ ├── EigenbaseContextException.java │ │ │ ├── EigenbaseException.java │ │ │ ├── Filterator.java │ │ │ ├── Glossary.java │ │ │ ├── IdentityHashSet.java │ │ │ ├── ImmutableIntList.java │ │ │ ├── ImmutableNullableList.java │ │ │ ├── IntList.java │ │ │ ├── IntegerIntervalSet.java │ │ │ ├── JsonBuilder.java │ │ │ ├── NlsString.java │ │ │ ├── Pair.java │ │ │ ├── Permutation.java │ │ │ ├── ReflectUtil.java │ │ │ ├── ReflectiveVisitDispatcher.java │ │ │ ├── ReflectiveVisitor.java │ │ │ ├── RhBase64.java │ │ │ ├── SaffronProperties.java │ │ │ ├── SerializableCharset.java │ │ │ ├── StackWriter.java │ │ │ ├── Stacks.java │ │ │ ├── Static.java │ │ │ ├── Template.java │ │ │ ├── UnmodifiableArrayList.java │ │ │ ├── Util.java │ │ │ ├── XmlOutput.java │ │ │ ├── mapping │ │ │ │ ├── IntPair.java │ │ │ │ ├── Mapping.java │ │ │ │ ├── MappingType.java │ │ │ │ ├── Mappings.java │ │ │ │ └── package-info.java │ │ │ └── package-info.java │ │ │ └── util14 │ │ │ ├── BasicDatetime.java │ │ │ ├── ConversionUtil.java │ │ │ ├── DateTimeUtil.java │ │ │ ├── EigenbaseParserException.java │ │ │ ├── EigenbaseValidatorException.java │ │ │ ├── NumberUtil.java │ │ │ ├── ZonelessDate.java │ │ │ ├── ZonelessDatetime.java │ │ │ ├── ZonelessTime.java │ │ │ ├── ZonelessTimestamp.java │ │ │ └── package-info.java │ └── resources │ │ ├── META-INF │ │ └── services │ │ │ └── java.sql.Driver │ │ ├── org │ │ └── eigenbase │ │ │ └── resource │ │ │ └── EigenbaseResource.properties │ │ └── version │ │ └── net-hydromatic-optiq-jdbc.properties │ └── test │ ├── java │ ├── net │ │ └── hydromatic │ │ │ └── optiq │ │ │ ├── examples │ │ │ └── foodmart │ │ │ │ └── java │ │ │ │ └── JdbcExample.java │ │ │ ├── impl │ │ │ ├── clone │ │ │ │ └── ArrayTableTest.java │ │ │ └── generate │ │ │ │ └── RangeTable.java │ │ │ ├── runtime │ │ │ └── BinarySearchTest.java │ │ │ ├── test │ │ │ ├── ExceptionMessageTest.java │ │ │ ├── FoodmartTest.java │ │ │ ├── JdbcAdapterTest.java │ │ │ ├── JdbcFrontJdbcBackLinqMiddleTest.java │ │ │ ├── JdbcFrontJdbcBackTest.java │ │ │ ├── JdbcFrontLinqBackTest.java │ │ │ ├── JdbcTest.java │ │ │ ├── LinqFrontJdbcBackTest.java │ │ │ ├── MaterializationTest.java │ │ │ ├── ModelTest.java │ │ │ ├── MultiJdbcSchemaJoinTest.java │ │ │ ├── OptiqAssert.java │ │ │ ├── OptiqSqlOperatorTest.java │ │ │ ├── OptiqSuite.java │ │ │ ├── ReflectiveSchemaTest.java │ │ │ ├── SqlFunctionsTest.java │ │ │ ├── SqlToRelConverterExtendedTest.java │ │ │ ├── TableInRootSchemaTest.java │ │ │ └── package-info.java │ │ │ ├── tools │ │ │ ├── FrameworksTest.java │ │ │ ├── PlannerTest.java │ │ │ └── TpchSchema.java │ │ │ └── util │ │ │ ├── PartiallyOrderedSetTest.java │ │ │ └── graph │ │ │ └── DirectedGraphTest.java │ └── org │ │ └── eigenbase │ │ ├── relopt │ │ ├── RelOptPlanReaderTest.java │ │ ├── RelOptUtilTest.java │ │ ├── RelWriterTest.java │ │ └── volcano │ │ │ ├── VolcanoPlannerTest.java │ │ │ └── VolcanoPlannerTraitTest.java │ │ ├── rex │ │ └── RexExecutorTest.java │ │ ├── sql │ │ ├── parser │ │ │ ├── SqlParserTest.java │ │ │ └── SqlUnParserTest.java │ │ └── test │ │ │ ├── DefaultSqlTestFactory.java │ │ │ ├── DelegatingSqlTestFactory.java │ │ │ ├── SqlAdvisorTest.java │ │ │ ├── SqlOperatorBaseTest.java │ │ │ ├── SqlOperatorTest.java │ │ │ ├── SqlPrettyWriterTest.java │ │ │ ├── SqlTestFactory.java │ │ │ ├── SqlTester.java │ │ │ ├── SqlTesterImpl.java │ │ │ ├── SqlTests.java │ │ │ ├── SqlTypeNameTest.java │ │ │ └── package-info.java │ │ ├── test │ │ ├── DiffRepository.java │ │ ├── DiffTestCase.java │ │ ├── EigenbaseResourceTest.java │ │ ├── EigenbaseTestCase.java │ │ ├── FilteratorTest.java │ │ ├── HepPlannerTest.java │ │ ├── MockCatalogReader.java │ │ ├── MockRelOptCost.java │ │ ├── MockRelOptPlanner.java │ │ ├── MockSqlOperatorTable.java │ │ ├── RelMetadataTest.java │ │ ├── RelOptRulesTest.java │ │ ├── RelOptTestBase.java │ │ ├── RexProgramTest.java │ │ ├── RexTransformerTest.java │ │ ├── SargTest.java │ │ ├── SqlLimitsTest.java │ │ ├── SqlTestGen.java │ │ ├── SqlToRelConverterTest.java │ │ ├── SqlToRelTestBase.java │ │ ├── SqlValidatorFeatureTest.java │ │ ├── SqlValidatorTest.java │ │ ├── SqlValidatorTestCase.java │ │ ├── concurrent │ │ │ ├── ConcurrentTestCommand.java │ │ │ ├── ConcurrentTestCommandExecutor.java │ │ │ ├── ConcurrentTestCommandGenerator.java │ │ │ ├── ConcurrentTestCommandScript.java │ │ │ ├── ConcurrentTestPlugin.java │ │ │ ├── ConcurrentTestPluginCommand.java │ │ │ ├── ConcurrentTestTimedCommandGenerator.java │ │ │ ├── SamplePlugin.java │ │ │ ├── mtsql │ │ │ ├── mtsql.loggers │ │ │ ├── package-info.java │ │ │ ├── test.mtsql │ │ │ └── test.ref │ │ └── package-info.java │ │ └── util │ │ ├── ChunkListTest.java │ │ ├── PermutationTestCase.java │ │ ├── ReflectVisitorTest.java │ │ ├── TestUtil.java │ │ ├── UtilTest.java │ │ └── mapping │ │ └── MappingTest.java │ └── resources │ ├── org │ └── eigenbase │ │ ├── sql │ │ └── test │ │ │ └── SqlPrettyWriterTest.xml │ │ └── test │ │ ├── HepPlannerTest.xml │ │ ├── RelOptRulesTest.xml │ │ ├── SqlLimitsTest.xml │ │ └── SqlToRelConverterTest.xml │ └── sql │ ├── agg.oq │ ├── misc.oq │ ├── outer.oq │ └── winagg.oq ├── mongodb ├── pom.xml └── src │ ├── main │ └── java │ │ └── net │ │ └── hydromatic │ │ └── optiq │ │ └── impl │ │ └── mongodb │ │ ├── MongoAggregateRel.java │ │ ├── MongoEnumerator.java │ │ ├── MongoFilterRel.java │ │ ├── MongoMethod.java │ │ ├── MongoProjectRel.java │ │ ├── MongoRel.java │ │ ├── MongoRules.java │ │ ├── MongoSchema.java │ │ ├── MongoSchemaFactory.java │ │ ├── MongoSortRel.java │ │ ├── MongoTable.java │ │ ├── MongoTableScan.java │ │ ├── MongoToEnumerableConverter.java │ │ ├── MongoToEnumerableConverterRule.java │ │ └── package-info.java │ └── test │ ├── java │ └── net │ │ └── hydromatic │ │ └── optiq │ │ └── test │ │ ├── MongoAdapterTest.java │ │ └── package-info.java │ └── resources │ ├── mongo-foodmart-model.json │ └── mongo-zips-model.json ├── plus ├── pom.xml └── src │ ├── main │ └── java │ │ └── net │ │ └── hydromatic │ │ └── optiq │ │ └── impl │ │ ├── tpcds │ │ ├── TpcdsSchema.java │ │ ├── TpcdsSchemaFactory.java │ │ └── package-info.java │ │ └── tpch │ │ ├── TpchSchema.java │ │ ├── TpchSchemaFactory.java │ │ └── package-info.java │ └── test │ └── java │ └── net │ └── hydromatic │ └── optiq │ ├── impl │ ├── tpcds │ │ └── TpcdsTest.java │ └── tpch │ │ └── TpchTest.java │ └── test │ └── PlusSuite.java ├── pom.xml ├── spark ├── pom.xml └── src │ ├── main │ └── java │ │ └── net │ │ └── hydromatic │ │ └── optiq │ │ └── impl │ │ └── spark │ │ ├── EnumerableToSparkConverter.java │ │ ├── EnumerableToSparkConverterRule.java │ │ ├── HttpServer.java │ │ ├── JdbcToSparkConverter.java │ │ ├── JdbcToSparkConverterRule.java │ │ ├── SparkHandlerImpl.java │ │ ├── SparkMethod.java │ │ ├── SparkRel.java │ │ ├── SparkRules.java │ │ ├── SparkRuntime.java │ │ ├── SparkToEnumerableConverter.java │ │ └── package-info.java │ └── test │ └── java │ └── net │ └── hydromatic │ └── optiq │ └── test │ ├── SparkAdapterTest.java │ └── package-info.java ├── splunk ├── pom.xml └── src │ ├── main │ └── java │ │ └── net │ │ └── hydromatic │ │ └── optiq │ │ └── impl │ │ └── splunk │ │ ├── SplunkDriver.java │ │ ├── SplunkDriverVersion.java │ │ ├── SplunkPushDownRule.java │ │ ├── SplunkQuery.java │ │ ├── SplunkSchema.java │ │ ├── SplunkTable.java │ │ ├── SplunkTableAccessRel.java │ │ ├── package-info.java │ │ ├── search │ │ ├── SearchResultListener.java │ │ ├── SplunkConnection.java │ │ ├── SplunkConnectionImpl.java │ │ └── package-info.java │ │ └── util │ │ ├── HttpUtils.java │ │ ├── SocketFactoryImpl.java │ │ ├── StringUtils.java │ │ ├── TrustAllSslSocketFactory.java │ │ └── package-info.java │ └── test │ └── java │ └── net │ └── hydromatic │ └── optiq │ └── test │ ├── SplunkAdapterTest.java │ └── package-info.java ├── sqlline ├── sqlline.bat ├── src └── main │ └── config │ └── checkstyle │ ├── checker.xml │ ├── header.txt │ └── suppressions.xml └── ubenchmark ├── pom.xml └── src └── main └── java └── net └── hydromatic └── optiq ├── StatementTest.java └── package-info.java /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | *.cs text diff=csharp 5 | *.java text diff=java 6 | *.html text diff=html 7 | *.py text diff=python 8 | *.pl text diff=perl 9 | *.pm text diff=perl 10 | *.css text 11 | *.js text 12 | *.sql text 13 | *.q text 14 | 15 | *.sh text eol=lf 16 | 17 | #test files, use lf so that size is same on windows as well 18 | data/files/*.dat text eol=lf 19 | 20 | *.bat text eol=crlf 21 | *.cmd text eol=crlf 22 | *.csproj text merge=union eol=crlf 23 | *.sln text merge=union eol=crlf 24 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | target 3 | .idea 4 | *.iml 5 | settings.xml 6 | .classpath.txt 7 | .fullclasspath.txt 8 | 9 | # eclipse 10 | .project 11 | .buildpath 12 | .classpath 13 | .settings 14 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: java 2 | jdk: 3 | - oraclejdk8 4 | - oraclejdk7 5 | - openjdk6 6 | branches: 7 | only: 8 | - master 9 | -------------------------------------------------------------------------------- /NOTICE: -------------------------------------------------------------------------------- 1 | optiq 2 | Copyright (C) 2012-2014 Julian Hyde 3 | 4 | =============================================================================== 5 | This product includes software from the Eigenbase project, licensed from 6 | DynamoBI Corporation, http://github.com/dynamobi/luciddb/. 7 | 8 | Copyright (C) 2005-2011 DynamoBI Corporation. 9 | 10 | =============================================================================== 11 | This software includes code from the Guava project, 12 | released under the Apache License, Version 2.0, 13 | and available from https://code.google.com/p/guava-libraries/. 14 | 15 | Copyright (C) 2007 The Guava Authors 16 | 17 | =============================================================================== 18 | Licensed under the Apache License, Version 2.0 (the "License"); 19 | you may not use this software except in compliance with the License. 20 | You may obtain a copy of the License at: 21 | 22 | http://www.apache.org/licenses/LICENSE-2.0 23 | 24 | Unless required by applicable law or agreed to in writing, software 25 | distributed under the License is distributed on an "AS IS" BASIS, 26 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 27 | See the License for the specific language governing permissions and 28 | limitations under the License. 29 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Build Status](https://travis-ci.org/julianhyde/optiq.png)](https://travis-ci.org/julianhyde/optiq) 2 | 3 | optiq 4 | ===== 5 | 6 | Optiq is a dynamic data management framework. 7 | 8 | On May 25th, 2014, Optiq entered the incubation process to become an Apache project. 9 | On September 30, 2014, Apache Optiq was renamed to Apache Calcite. 10 | The home page is Apache Calcite. 11 | 12 | This site is retained for historical interest. 13 | The original README file is here. 14 | -------------------------------------------------------------------------------- /avatica/src/main/java/net/hydromatic/avatica/AvaticaJdbc40Factory.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | package net.hydromatic.avatica; 19 | 20 | /** 21 | * Implementation of {@link AvaticaFactory} 22 | * for JDBC 4.0 (corresponds to JDK 1.6). 23 | */ 24 | public class AvaticaJdbc40Factory extends AvaticaJdbc41Factory { 25 | /** Creates a JDBC factory. */ 26 | AvaticaJdbc40Factory() { 27 | super(4, 0); 28 | } 29 | } 30 | 31 | // End AvaticaJdbc40Factory.java 32 | -------------------------------------------------------------------------------- /avatica/src/main/java/net/hydromatic/avatica/AvaticaPrepareResult.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | package net.hydromatic.avatica; 19 | 20 | import java.util.List; 21 | 22 | /** 23 | * Result of preparing a statement. 24 | */ 25 | public interface AvaticaPrepareResult { 26 | List getColumnList(); 27 | String getSql(); 28 | List getParameterList(); 29 | } 30 | 31 | // End AvaticaPrepareResult.java 32 | -------------------------------------------------------------------------------- /avatica/src/main/java/net/hydromatic/avatica/Casing.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | package net.hydromatic.avatica; 19 | 20 | /** Policy for converting case of identifiers before storing them. 21 | * 22 | *

A database often has policies for quoted versus unquoted identifiers. 23 | * For example, Oracle converts unquoted identifiers to upper-case, but 24 | * quoted identifiers are unchanged.

*/ 25 | public enum Casing { 26 | /** The case of identifiers is not changed. */ 27 | UNCHANGED, 28 | 29 | /** Identifiers are converted to upper-case. */ 30 | TO_UPPER, 31 | 32 | /** Identifiers are converted to lower-case. */ 33 | TO_LOWER 34 | } 35 | 36 | // End Casing.java 37 | -------------------------------------------------------------------------------- /avatica/src/main/java/net/hydromatic/avatica/ConnectionConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | package net.hydromatic.avatica; 19 | 20 | /** 21 | * Connection configuration. 22 | */ 23 | public interface ConnectionConfig { 24 | String schema(); 25 | String timeZone(); 26 | } 27 | 28 | // End ConnectionConfig.java 29 | -------------------------------------------------------------------------------- /avatica/src/main/java/net/hydromatic/avatica/Quoting.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | package net.hydromatic.avatica; 19 | 20 | /** Syntax for quoting identifiers in SQL statements. */ 21 | public enum Quoting { 22 | /** Quote identifiers in double-quotes. For example, {@code "my id"}. */ 23 | DOUBLE_QUOTE("\""), 24 | 25 | /** Quote identifiers in back-quotes. For example, {@code `my id`}. */ 26 | BACK_TICK("`"), 27 | 28 | /** Quote identifiers in brackets. For example, {@code [my id]}. */ 29 | BRACKET("["); 30 | 31 | public String string; 32 | 33 | Quoting(String string) { 34 | this.string = string; 35 | } 36 | } 37 | 38 | // End Quoting.java 39 | -------------------------------------------------------------------------------- /avatica/src/main/java/net/hydromatic/avatica/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | 19 | /** 20 | * Avatica JDBC framework. 21 | */ 22 | package net.hydromatic.avatica; 23 | 24 | // End package-info.java 25 | -------------------------------------------------------------------------------- /avatica/src/test/java/net/hydromatic/avatica/test/AvaticaSuite.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | package net.hydromatic.avatica.test; 19 | 20 | import org.junit.runner.RunWith; 21 | import org.junit.runners.Suite; 22 | 23 | /** 24 | * Avatica test suite. 25 | */ 26 | @RunWith(Suite.class) 27 | @Suite.SuiteClasses({ 28 | ConnectStringParserTest.class 29 | }) 30 | public class AvaticaSuite { 31 | } 32 | 33 | // End AvaticaSuite.java 34 | -------------------------------------------------------------------------------- /avatica/src/test/java/net/hydromatic/avatica/test/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | 19 | /** 20 | * Provides utility classes. 21 | */ 22 | package org.eigenbase.util; 23 | 24 | // End package-info.java 25 | -------------------------------------------------------------------------------- /core/src/main/codegen/includes/parserImpls.ftl: -------------------------------------------------------------------------------- 1 | <#-- 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | --> 18 | 19 | <#-- 20 | Add implementations of additional parser statements, literals or 21 | data types. 22 | 23 | Example of SqlShowTables() implementation: 24 | SqlNode SqlShowTables() 25 | { 26 | ...local variables... 27 | } 28 | { 29 | 30 | ... 31 | { 32 | return SqlShowTables(...) 33 | } 34 | } 35 | --> 36 | -------------------------------------------------------------------------------- /core/src/main/java/net/hydromatic/optiq/AggregateFunction.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | package net.hydromatic.optiq; 19 | 20 | import org.eigenbase.reltype.RelDataType; 21 | import org.eigenbase.reltype.RelDataTypeFactory; 22 | 23 | /** 24 | * Function that combines several values into a scalar result. 25 | */ 26 | public interface AggregateFunction extends Function { 27 | /** 28 | * Returns the return type of this function, constructed using the given 29 | * type factory. 30 | * 31 | * @param typeFactory Type factory 32 | */ 33 | RelDataType getReturnType(RelDataTypeFactory typeFactory); 34 | } 35 | 36 | // End AggregateFunction.java 37 | -------------------------------------------------------------------------------- /core/src/main/java/net/hydromatic/optiq/Demo.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | package net.hydromatic.optiq; 19 | 20 | import java.util.ArrayList; 21 | 22 | /** 23 | * Demo. 24 | */ 25 | public class Demo { 26 | private Demo() { 27 | } 28 | 29 | public static void main(String[] args) { 30 | ArrayList names = new ArrayList(); 31 | names.add("John"); 32 | names.add("Paul"); 33 | names.add("George"); 34 | names.add("Ringo"); 35 | 36 | Iterable nameIterable = names; 37 | 38 | for (String name : nameIterable) { 39 | System.out.println(name); 40 | } 41 | } 42 | } 43 | 44 | // End Demo.java 45 | -------------------------------------------------------------------------------- /core/src/main/java/net/hydromatic/optiq/Function.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | package net.hydromatic.optiq; 19 | 20 | import java.util.List; 21 | 22 | /** 23 | * Named expression that accepts parameters and returns a result. 24 | * 25 | *

The application may occur at compile time (for a macro) or at run time 26 | * (for a regular function). The result may be a relation, and so might any of 27 | * the parameters.

28 | * 29 | *

Functions are registered in a {@link Schema}, and may be queried by name 30 | * ({@link Schema#getFunctions(String)}) then overloads resolved based on 31 | * parameter types.

32 | * 33 | * @see TableMacro 34 | * @see ScalarFunction 35 | */ 36 | public interface Function { 37 | /** 38 | * Returns the parameters of this function. 39 | * 40 | * @return Parameters; never null 41 | */ 42 | List getParameters(); 43 | } 44 | 45 | // End Function.java 46 | -------------------------------------------------------------------------------- /core/src/main/java/net/hydromatic/optiq/ImplementableFunction.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | package net.hydromatic.optiq; 19 | 20 | import net.hydromatic.optiq.rules.java.CallImplementor; 21 | 22 | /** 23 | * Function that can be translated to java code. 24 | *

25 | * @see net.hydromatic.optiq.ScalarFunction 26 | * @see net.hydromatic.optiq.TableFunction 27 | */ 28 | public interface ImplementableFunction extends Function { 29 | /** 30 | * Returns implementor that translates the function to linq4j expression. 31 | * @return implementor that translates the function to linq4j expression. 32 | */ 33 | CallImplementor getImplementor(); 34 | } 35 | 36 | // End ImplementableFunction.java 37 | -------------------------------------------------------------------------------- /core/src/main/java/net/hydromatic/optiq/ScalarFunction.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | package net.hydromatic.optiq; 19 | 20 | import org.eigenbase.reltype.RelDataType; 21 | import org.eigenbase.reltype.RelDataTypeFactory; 22 | 23 | /** 24 | * Function that returns a scalar result. 25 | */ 26 | public interface ScalarFunction extends Function { 27 | /** 28 | * Returns the return type of this function, constructed using the given 29 | * type factory. 30 | * 31 | * @param typeFactory Type factory 32 | */ 33 | RelDataType getReturnType(RelDataTypeFactory typeFactory); 34 | } 35 | 36 | // End ScalarFunction.java 37 | -------------------------------------------------------------------------------- /core/src/main/java/net/hydromatic/optiq/SemiMutableSchema.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | package net.hydromatic.optiq; 19 | 20 | 21 | /** 22 | * Schema to which materializations can be added. 23 | */ 24 | public interface SemiMutableSchema extends Schema { 25 | } 26 | 27 | // End SemiMutableSchema.java 28 | -------------------------------------------------------------------------------- /core/src/main/java/net/hydromatic/optiq/Statistic.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | package net.hydromatic.optiq; 19 | 20 | import java.util.BitSet; 21 | 22 | /** 23 | * Statistics about a {@link Table}. 24 | * 25 | *

Each of the methods may return {@code null} meaning "not known".

26 | * 27 | * @see Statistics 28 | */ 29 | public interface Statistic { 30 | /** Returns the approximate number of rows in the table. */ 31 | Double getRowCount(); 32 | 33 | /** Returns whether the given set of columns is a unique key, or a superset 34 | * of a unique key, of the table. 35 | */ 36 | boolean isKey(BitSet columns); 37 | } 38 | 39 | // End Statistic.java 40 | -------------------------------------------------------------------------------- /core/src/main/java/net/hydromatic/optiq/TableMacro.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | package net.hydromatic.optiq; 19 | 20 | import java.util.List; 21 | 22 | /** 23 | * Function that returns a {@link Table}. 24 | * 25 | *

As the name "macro" implies, this is invoked at "compile time", that is, 26 | * during query preparation. Compile-time expansion of table expressions allows 27 | * for some very powerful query-optimizations.

28 | */ 29 | public interface TableMacro extends Function { 30 | /** 31 | * Applies arguments to yield a table. 32 | * 33 | * @param arguments Arguments 34 | * @return Table 35 | */ 36 | TranslatableTable apply(List arguments); 37 | } 38 | 39 | // End TableMacro.java 40 | -------------------------------------------------------------------------------- /core/src/main/java/net/hydromatic/optiq/config/OptiqConnectionConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | package net.hydromatic.optiq.config; 19 | 20 | import net.hydromatic.avatica.Casing; 21 | import net.hydromatic.avatica.ConnectionConfig; 22 | import net.hydromatic.avatica.Quoting; 23 | 24 | /** Interface for reading connection properties within Optiq code. There is 25 | * a method for every property. At some point there will be similar config 26 | * classes for system and statement properties. */ 27 | public interface OptiqConnectionConfig extends ConnectionConfig { 28 | boolean autoTemp(); 29 | boolean materializationsEnabled(); 30 | String model(); 31 | Lex lex(); 32 | Quoting quoting(); 33 | Casing unquotedCasing(); 34 | Casing quotedCasing(); 35 | boolean caseSensitive(); 36 | boolean spark(); 37 | } 38 | 39 | // End OptiqConnectionConfig.java 40 | -------------------------------------------------------------------------------- /core/src/main/java/net/hydromatic/optiq/config/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | 19 | /** 20 | * Configuration. 21 | */ 22 | package net.hydromatic.optiq.config; 23 | 24 | // End package-info.java 25 | -------------------------------------------------------------------------------- /core/src/main/java/net/hydromatic/optiq/impl/AbstractTable.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | package net.hydromatic.optiq.impl; 19 | 20 | import net.hydromatic.optiq.*; 21 | 22 | /** 23 | * Abstract base class for implementing {@link Table}. 24 | */ 25 | public abstract class AbstractTable implements Table { 26 | protected AbstractTable() { 27 | } 28 | 29 | // Default implementation. Override if you have statistics. 30 | public Statistic getStatistic() { 31 | return Statistics.UNKNOWN; 32 | } 33 | 34 | public Schema.TableType getJdbcTableType() { 35 | return Schema.TableType.TABLE; 36 | } 37 | } 38 | 39 | // End AbstractTable.java 40 | -------------------------------------------------------------------------------- /core/src/main/java/net/hydromatic/optiq/impl/clone/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | 19 | /** 20 | * Provides utility classes. 21 | */ 22 | package net.hydromatic.optiq.impl.clone; 23 | 24 | // End package-info.java 25 | -------------------------------------------------------------------------------- /core/src/main/java/net/hydromatic/optiq/impl/java/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | 19 | /** 20 | * Query provider based on Java in-memory data 21 | * structures. 22 | */ 23 | package net.hydromatic.optiq.impl.java; 24 | 25 | // End package-info.java 26 | -------------------------------------------------------------------------------- /core/src/main/java/net/hydromatic/optiq/impl/jdbc/JdbcQueryProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | package net.hydromatic.optiq.impl.jdbc; 19 | 20 | import net.hydromatic.linq4j.*; 21 | 22 | /** 23 | * Implementation of {@link QueryProvider} that talks to JDBC databases. 24 | */ 25 | public final class JdbcQueryProvider extends QueryProviderImpl { 26 | public static final JdbcQueryProvider INSTANCE = new JdbcQueryProvider(); 27 | 28 | private JdbcQueryProvider() { 29 | } 30 | 31 | public Enumerator executeQuery(Queryable queryable) { 32 | return null; 33 | } 34 | } 35 | 36 | // End JdbcQueryProvider.java 37 | -------------------------------------------------------------------------------- /core/src/main/java/net/hydromatic/optiq/impl/jdbc/JdbcRel.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | package net.hydromatic.optiq.impl.jdbc; 19 | 20 | import org.eigenbase.rel.RelNode; 21 | 22 | /** 23 | * Relational expression that uses JDBC calling convention. 24 | */ 25 | public interface JdbcRel extends RelNode { 26 | JdbcImplementor.Result implement(JdbcImplementor implementor); 27 | } 28 | 29 | // End JdbcRel.java 30 | -------------------------------------------------------------------------------- /core/src/main/java/net/hydromatic/optiq/impl/jdbc/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | 19 | /** 20 | * Query provider based on a JDBC data source. 21 | */ 22 | package net.hydromatic.optiq.impl.jdbc; 23 | 24 | // End package-info.java 25 | -------------------------------------------------------------------------------- /core/src/main/java/net/hydromatic/optiq/impl/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | 19 | /** 20 | * Utilities to help implement Optiq's SPIs. 21 | */ 22 | package net.hydromatic.optiq.impl; 23 | 24 | // End package-info.java 25 | -------------------------------------------------------------------------------- /core/src/main/java/net/hydromatic/optiq/jdbc/OptiqJdbc40Factory.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | package net.hydromatic.optiq.jdbc; 19 | 20 | /** 21 | * Implementation of {@link net.hydromatic.avatica.AvaticaFactory} 22 | * for Optiq and JDBC 4.0 (corresponds to JDK 1.6). 23 | */ 24 | public class OptiqJdbc40Factory extends OptiqJdbc41Factory { 25 | /** Creates a factory for JDBC version 4.1. */ 26 | public OptiqJdbc40Factory() { 27 | super(4, 0); 28 | } 29 | } 30 | 31 | // End OptiqJdbc40Factory.java 32 | -------------------------------------------------------------------------------- /core/src/main/java/net/hydromatic/optiq/jdbc/OptiqRootSchema.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | package net.hydromatic.optiq.jdbc; 19 | 20 | import net.hydromatic.optiq.Schema; 21 | 22 | /** 23 | * Root schema. 24 | */ 25 | public class OptiqRootSchema extends OptiqSchema { 26 | /** Creates a root schema. */ 27 | OptiqRootSchema(Schema schema) { 28 | super(null, schema, ""); 29 | } 30 | } 31 | 32 | // End OptiqRootSchema.java 33 | -------------------------------------------------------------------------------- /core/src/main/java/net/hydromatic/optiq/jdbc/SqlTimeoutException.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | package net.hydromatic.optiq.jdbc; 19 | 20 | import java.sql.SQLException; 21 | 22 | /** 23 | * Indicates that an operation timed out. This is not an error; you can 24 | * retry the operation. 25 | */ 26 | public class SqlTimeoutException 27 | extends SQLException { 28 | SqlTimeoutException() { 29 | // SQLException(reason, SQLState, vendorCode) 30 | // REVIEW mb 19-Jul-05 Is there a standard SQLState? 31 | super("timeout", null, 0); 32 | } 33 | } 34 | 35 | // End SqlTimeoutException.java 36 | -------------------------------------------------------------------------------- /core/src/main/java/net/hydromatic/optiq/jdbc/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | 19 | /** 20 | * JDBC driver for Optiq. 21 | */ 22 | package net.hydromatic.optiq.jdbc; 23 | 24 | // End package-info.java 25 | -------------------------------------------------------------------------------- /core/src/main/java/net/hydromatic/optiq/model/JsonColumn.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | package net.hydromatic.optiq.model; 19 | 20 | /** 21 | * JSON object representing a column. 22 | * 23 | * @see JsonRoot Description of JSON schema elements 24 | */ 25 | public class JsonColumn { 26 | public String name; 27 | } 28 | 29 | // End JsonColumn.java 30 | -------------------------------------------------------------------------------- /core/src/main/java/net/hydromatic/optiq/model/JsonCustomTable.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | package net.hydromatic.optiq.model; 19 | 20 | import java.util.Map; 21 | 22 | /** 23 | * Custom table schema element. 24 | * 25 | * @see JsonRoot Description of schema elements 26 | */ 27 | public class JsonCustomTable extends JsonTable { 28 | /** Name of the factory class for this table. Must implement interface 29 | * {@link net.hydromatic.optiq.TableFactory} and have a public default 30 | * constructor. */ 31 | public String factory; 32 | 33 | /** Operand. May be a JSON object (represented as Map) or null. */ 34 | public Map operand; 35 | 36 | public void accept(ModelHandler handler) { 37 | handler.visit(this); 38 | } 39 | } 40 | 41 | // End JsonCustomTable.java 42 | -------------------------------------------------------------------------------- /core/src/main/java/net/hydromatic/optiq/model/JsonFunction.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | package net.hydromatic.optiq.model; 19 | 20 | import java.util.List; 21 | 22 | /** 23 | * Function schema element. 24 | * 25 | * @see JsonRoot Description of schema elements 26 | */ 27 | public class JsonFunction { 28 | public String name; 29 | public String className; 30 | public List path; 31 | 32 | public void accept(ModelHandler handler) { 33 | handler.visit(this); 34 | } 35 | } 36 | 37 | // End JsonFunction.java 38 | -------------------------------------------------------------------------------- /core/src/main/java/net/hydromatic/optiq/model/JsonJdbcSchema.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | package net.hydromatic.optiq.model; 19 | 20 | /** 21 | * JSON object representing a schema that maps to a JDBC database. 22 | * 23 | * @see JsonRoot Description of JSON schema elements 24 | */ 25 | public class JsonJdbcSchema extends JsonSchema { 26 | public String jdbcDriver; 27 | public String jdbcUrl; 28 | public String jdbcUser; 29 | public String jdbcPassword; 30 | public String jdbcCatalog; 31 | public String jdbcSchema; 32 | 33 | @Override 34 | public void accept(ModelHandler handler) { 35 | handler.visit(this); 36 | } 37 | } 38 | 39 | // End JsonJdbcSchema.java 40 | -------------------------------------------------------------------------------- /core/src/main/java/net/hydromatic/optiq/model/JsonMaterialization.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | package net.hydromatic.optiq.model; 19 | 20 | /** 21 | * Element that describes how a table is a materialization of a query. 22 | * 23 | * @see JsonRoot Description of schema elements 24 | */ 25 | public class JsonMaterialization { 26 | public String view; 27 | public String table; 28 | public String sql; 29 | 30 | public void accept(ModelHandler handler) { 31 | handler.visit(this); 32 | } 33 | 34 | @Override 35 | public String toString() { 36 | return "JsonMaterialization(table=" + table + ", view=" + view + ")"; 37 | } 38 | } 39 | 40 | // End JsonMaterialization.java 41 | -------------------------------------------------------------------------------- /core/src/main/java/net/hydromatic/optiq/model/JsonView.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | package net.hydromatic.optiq.model; 19 | 20 | import java.util.List; 21 | 22 | /** 23 | * View schema element. 24 | * 25 | * @see JsonRoot Description of schema elements 26 | */ 27 | public class JsonView extends JsonTable { 28 | /** SQL query that is the definition of the view. */ 29 | public String sql; 30 | 31 | /** Schema name(s) to use when resolving query. If not specified, defaults 32 | * to current schema. */ 33 | public List path; 34 | 35 | public void accept(ModelHandler handler) { 36 | handler.visit(this); 37 | } 38 | 39 | @Override 40 | public String toString() { 41 | return "JsonView(name=" + name + ")"; 42 | } 43 | } 44 | 45 | // End JsonView.java 46 | -------------------------------------------------------------------------------- /core/src/main/java/net/hydromatic/optiq/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | 19 | /** 20 | * Main package for Optiq, the dynamic data management platform. 21 | */ 22 | package net.hydromatic.optiq; 23 | 24 | // End package-info.java 25 | -------------------------------------------------------------------------------- /core/src/main/java/net/hydromatic/optiq/prepare/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | 19 | /** 20 | * Preparation of queries (parsing, planning and implementation). 21 | */ 22 | package net.hydromatic.optiq.prepare; 23 | 24 | // End package-info.java 25 | -------------------------------------------------------------------------------- /core/src/main/java/net/hydromatic/optiq/rules/java/AggResultContext.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | package net.hydromatic.optiq.rules.java; 19 | 20 | /** 21 | * Information for a call to {@link AggImplementor#implementResult(AggContext, AggResultContext)} 22 | * Typically, the aggregation implementation will convert {@link #accumulator()} 23 | * to the resulting value of the aggregation. 24 | * The implementation MUST NOT destroy the contents of {@link #accumulator()}. 25 | */ 26 | public interface AggResultContext extends NestedBlockBuilder, AggResetContext { 27 | } 28 | 29 | // End AggResultContext.java 30 | -------------------------------------------------------------------------------- /core/src/main/java/net/hydromatic/optiq/rules/java/CallImplementor.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | package net.hydromatic.optiq.rules.java; 19 | 20 | import net.hydromatic.linq4j.expressions.Expression; 21 | 22 | import org.eigenbase.rex.RexCall; 23 | 24 | /** 25 | * Implements a call via given translator. 26 | *

27 | * @see net.hydromatic.optiq.ScalarFunction 28 | * @see net.hydromatic.optiq.TableFunction 29 | * @see net.hydromatic.optiq.rules.java.RexImpTable 30 | */ 31 | public interface CallImplementor { 32 | /** Implements a call. */ 33 | Expression implement( 34 | RexToLixTranslator translator, 35 | RexCall call, 36 | RexImpTable.NullAs nullAs); 37 | } 38 | -------------------------------------------------------------------------------- /core/src/main/java/net/hydromatic/optiq/rules/java/WinAggContext.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | package net.hydromatic.optiq.rules.java; 19 | 20 | /** 21 | * Marker interface to allow {@link net.hydromatic.optiq.rules.java.AggImplementor} to tell if it is used in 22 | * regular or windowed context. 23 | */ 24 | public interface WinAggContext extends AggContext { 25 | } 26 | 27 | // End WinAggContext.java 28 | -------------------------------------------------------------------------------- /core/src/main/java/net/hydromatic/optiq/rules/java/WinAggResetContext.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | package net.hydromatic.optiq.rules.java; 19 | 20 | /** 21 | * Information for a call to {@link AggImplementor#implementReset(AggContext, AggResetContext)}. 22 | * {@link AggResetContext} provides access to the accumulator variables 23 | * that should be reset. 24 | * Note: the very first reset of windowed aggregates is performed with null 25 | * knowledge of indices and row count in the partition. 26 | * In other words, the implementation should treat indices and partition row 27 | * count as a hint to pre-size the collections. 28 | */ 29 | public interface WinAggResetContext 30 | extends AggResetContext, WinAggFrameContext { 31 | } 32 | 33 | // End WinAggResetContext.java 34 | -------------------------------------------------------------------------------- /core/src/main/java/net/hydromatic/optiq/rules/java/impl/AggAddContextImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | package net.hydromatic.optiq.rules.java.impl; 19 | 20 | import net.hydromatic.linq4j.expressions.BlockBuilder; 21 | import net.hydromatic.linq4j.expressions.Expression; 22 | 23 | import net.hydromatic.optiq.rules.java.AggAddContext; 24 | 25 | import java.util.List; 26 | 27 | /** 28 | * Implementation of {@link net.hydromatic.optiq.rules.java.AggAddContext}. 29 | */ 30 | public abstract class AggAddContextImpl extends AggResultContextImpl 31 | implements AggAddContext { 32 | public AggAddContextImpl(BlockBuilder block, List accumulator) { 33 | super(block, accumulator); 34 | } 35 | 36 | public final List arguments() { 37 | return rowTranslator().translateList(rexArguments()); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /core/src/main/java/net/hydromatic/optiq/rules/java/impl/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | 19 | /** 20 | * Optiq-specific classes for implementation of regular and window aggregates. 21 | */ 22 | package net.hydromatic.optiq.rules.java.impl; 23 | 24 | // End package-info.java 25 | -------------------------------------------------------------------------------- /core/src/main/java/net/hydromatic/optiq/rules/java/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | 19 | /** 20 | * Query optimizer rules for Java calling convention. 21 | */ 22 | package net.hydromatic.optiq.rules.java; 23 | 24 | // End package-info.java 25 | -------------------------------------------------------------------------------- /core/src/main/java/net/hydromatic/optiq/rules/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | 19 | /** 20 | * Query optimizer rules. 21 | */ 22 | package net.hydromatic.optiq.rules; 23 | 24 | // End package-info.java 25 | -------------------------------------------------------------------------------- /core/src/main/java/net/hydromatic/optiq/runtime/Bindable.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | package net.hydromatic.optiq.runtime; 19 | 20 | import net.hydromatic.linq4j.Enumerable; 21 | 22 | import net.hydromatic.optiq.DataContext; 23 | 24 | /** 25 | * Statement that can be bound to a {@link DataContext} and then executed. 26 | * 27 | * @param Element type of the resulting enumerable 28 | */ 29 | public interface Bindable { 30 | /** 31 | * Executes this statement and returns an enumerable which will yield rows. 32 | * The {@code environment} parameter provides the values in the root of the 33 | * environment (usually schemas). 34 | * 35 | * @param dataContext Environment that provides tables 36 | * @return Enumerable over rows 37 | */ 38 | Enumerable bind(DataContext dataContext); 39 | } 40 | 41 | // End Bindable.java 42 | -------------------------------------------------------------------------------- /core/src/main/java/net/hydromatic/optiq/runtime/Typed.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | package net.hydromatic.optiq.runtime; 19 | 20 | import java.lang.reflect.Type; 21 | 22 | /** 23 | * Adds type information to a {@link net.hydromatic.linq4j.Enumerable}. 24 | */ 25 | public interface Typed { 26 | /** 27 | * Gets the type of the element(s) that are returned in this collection. 28 | */ 29 | Type getElementType(); 30 | } 31 | 32 | // End Typed.java 33 | -------------------------------------------------------------------------------- /core/src/main/java/net/hydromatic/optiq/runtime/Unit.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | package net.hydromatic.optiq.runtime; 19 | 20 | /** 21 | * Synthetic record with zero fields. 22 | * 23 | *

Since all instances are identical, {@code Unit} is a singleton.

24 | */ 25 | public class Unit implements Comparable { 26 | public static final Unit INSTANCE = new Unit(); 27 | 28 | private Unit() { 29 | } 30 | 31 | public int compareTo(Unit that) { 32 | return 0; 33 | } 34 | 35 | public String toString() { 36 | return "{}"; 37 | } 38 | } 39 | 40 | // End Unit.java 41 | -------------------------------------------------------------------------------- /core/src/main/java/net/hydromatic/optiq/runtime/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | 19 | /** 20 | * Utilities required at runtime. 21 | */ 22 | package net.hydromatic.optiq.runtime; 23 | 24 | // End package-info.java 25 | -------------------------------------------------------------------------------- /core/src/main/java/net/hydromatic/optiq/server/OptiqServer.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | package net.hydromatic.optiq.server; 19 | 20 | /** 21 | * Server. 22 | * 23 | *

Represents shared state among connections, and will have monitoring and 24 | * management facilities. 25 | */ 26 | public interface OptiqServer { 27 | void removeStatement(OptiqServerStatement optiqServerStatement); 28 | 29 | void addStatement(OptiqServerStatement optiqServerStatement); 30 | } 31 | 32 | // End OptiqServer.java 33 | -------------------------------------------------------------------------------- /core/src/main/java/net/hydromatic/optiq/server/OptiqServerStatement.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | package net.hydromatic.optiq.server; 19 | 20 | import net.hydromatic.optiq.jdbc.OptiqConnection; 21 | import net.hydromatic.optiq.jdbc.OptiqPrepare; 22 | 23 | /** 24 | * Statement within an Optiq server. 25 | */ 26 | public interface OptiqServerStatement { 27 | /** Creates a context for preparing a statement for execution. */ 28 | OptiqPrepare.Context createPrepareContext(); 29 | 30 | /** Returns the connection. */ 31 | OptiqConnection getConnection(); 32 | } 33 | 34 | // End OptiqServerStatement.java 35 | -------------------------------------------------------------------------------- /core/src/main/java/net/hydromatic/optiq/server/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | 19 | /** 20 | * Provides a server for hosting Optiq connections. 21 | */ 22 | package net.hydromatic.optiq.server; 23 | 24 | // End package-info.java 25 | -------------------------------------------------------------------------------- /core/src/main/java/net/hydromatic/optiq/tools/Program.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | package net.hydromatic.optiq.tools; 19 | 20 | import org.eigenbase.rel.RelNode; 21 | import org.eigenbase.relopt.RelOptPlanner; 22 | import org.eigenbase.relopt.RelTraitSet; 23 | 24 | /** 25 | * Program that transforms a relational expression into another relational 26 | * expression. 27 | * 28 | *

A planner is a sequence of programs, each of which is sometimes called 29 | * a "phase". 30 | * The most typical program is an invocation of the volcano planner with a 31 | * particular {@link net.hydromatic.optiq.tools.RuleSet}.

32 | */ 33 | public interface Program { 34 | RelNode run(RelOptPlanner planner, RelNode rel, 35 | RelTraitSet requiredOutputTraits); 36 | } 37 | 38 | // End Program.java 39 | -------------------------------------------------------------------------------- /core/src/main/java/net/hydromatic/optiq/tools/RelConversionException.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | package net.hydromatic.optiq.tools; 19 | 20 | /** 21 | * An Exception thrown when attempting conversion to a set of 22 | * {@link org.eigenbase.rel.RelNode}s. 23 | */ 24 | public class RelConversionException extends Exception { 25 | /** Creates a RelConversionException with the specified detail message and 26 | * cause. */ 27 | public RelConversionException(String message, Throwable cause) { 28 | super(message, cause); 29 | } 30 | 31 | /** Creates a RelConversionException with the specified detail message. */ 32 | public RelConversionException(String message) { 33 | super(message); 34 | } 35 | 36 | /** Creates a RelConversionException with the specified cause. */ 37 | public RelConversionException(Throwable cause) { 38 | super(cause); 39 | } 40 | } 41 | 42 | // End RelConversionException.java 43 | -------------------------------------------------------------------------------- /core/src/main/java/net/hydromatic/optiq/tools/RuleSet.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | package net.hydromatic.optiq.tools; 19 | 20 | import org.eigenbase.relopt.RelOptRule; 21 | 22 | /** 23 | * A set rules associated with a particular 24 | * type of invocation of the {@link Planner}. 25 | */ 26 | public interface RuleSet extends Iterable { 27 | } 28 | 29 | // End RuleSet.java 30 | -------------------------------------------------------------------------------- /core/src/main/java/net/hydromatic/optiq/tools/ValidationException.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | package net.hydromatic.optiq.tools; 19 | 20 | /** 21 | * An Exception thrown when attempting to validate a SQL parse tree. 22 | */ 23 | public class ValidationException extends Exception { 24 | /** Creates a ValidationException with the specified detail message and 25 | * cause. */ 26 | public ValidationException(String message, Throwable cause) { 27 | super(message, cause); 28 | } 29 | 30 | /** Creates a ValidationException with the specified detail message. */ 31 | public ValidationException(String message) { 32 | super(message); 33 | } 34 | 35 | /** Creates a ValidationException with the specified cause. */ 36 | public ValidationException(Throwable cause) { 37 | super(cause); 38 | } 39 | } 40 | 41 | // End ValidationException.java 42 | -------------------------------------------------------------------------------- /core/src/main/java/net/hydromatic/optiq/tools/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | 19 | /** 20 | * Provides utility classes. 21 | */ 22 | package net.hydromatic.optiq.tools; 23 | 24 | // End package-info.java 25 | -------------------------------------------------------------------------------- /core/src/main/java/net/hydromatic/optiq/util/graph/CycleDetector.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | package net.hydromatic.optiq.util.graph; 19 | 20 | import java.util.Set; 21 | 22 | /** 23 | * Detects cycles in directed graphs. 24 | * 25 | * @param Vertex type 26 | * @param Edge type 27 | */ 28 | public class CycleDetector { 29 | private final DirectedGraph graph; 30 | 31 | public CycleDetector(DirectedGraph graph) { 32 | this.graph = graph; 33 | } 34 | 35 | public Set findCycles() { 36 | return new TopologicalOrderIterator(graph).findCycles(); 37 | } 38 | } 39 | 40 | // End CycleDetector.java 41 | 42 | -------------------------------------------------------------------------------- /core/src/main/java/net/hydromatic/optiq/util/graph/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | 19 | /** 20 | * Graph-theoretic algorithms and data structures. 21 | */ 22 | package net.hydromatic.optiq.util.graph; 23 | 24 | // End package-info.java 25 | -------------------------------------------------------------------------------- /core/src/main/java/net/hydromatic/optiq/util/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | 19 | /** 20 | * Provides utility classes. 21 | */ 22 | package net.hydromatic.optiq.util; 23 | 24 | // End package-info.java 25 | -------------------------------------------------------------------------------- /core/src/main/java/org/eigenbase/javac/JavaCompiler.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | package org.eigenbase.javac; 19 | 20 | /** 21 | * The interface JavaCompiler represents an interface to invoke a 22 | * regular Java compiler. Classes implementing this interface should accept the 23 | * same arguments as Sun's javac. 24 | */ 25 | public interface JavaCompiler { 26 | //~ Methods ---------------------------------------------------------------- 27 | 28 | void compile(); 29 | 30 | JavaCompilerArgs getArgs(); 31 | 32 | ClassLoader getClassLoader(); 33 | 34 | int getTotalByteCodeSize(); 35 | } 36 | 37 | // End JavaCompiler.java 38 | -------------------------------------------------------------------------------- /core/src/main/java/org/eigenbase/javac/SynchronizedJaninoCompiler.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | package org.eigenbase.javac; 19 | 20 | /** 21 | * SynchronizedJaninoCompiler exists as a fallback in case Janino has 22 | * more multi-threading bugs. We hope never to have to use it, but 23 | * if necessary: 24 | * alter system set "javaCompilerClassName" = 25 | * 'org.eigenbase.javac.SynchronizedJaninoCompiler'; 26 | */ 27 | public class SynchronizedJaninoCompiler extends JaninoCompiler { 28 | // override JaninoCompiler 29 | public void compile() { 30 | synchronized (SynchronizedJaninoCompiler.class) { 31 | super.compile(); 32 | } 33 | } 34 | } 35 | 36 | // End SynchronizedJaninoCompiler.java 37 | -------------------------------------------------------------------------------- /core/src/main/java/org/eigenbase/javac/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | 19 | /** 20 | * Provides compilers for Java code. 21 | */ 22 | package org.eigenbase.javac; 23 | 24 | // End package-info.java 25 | -------------------------------------------------------------------------------- /core/src/main/java/org/eigenbase/jdbc4/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | 19 | /** 20 | * Provides source compatibility gunk when building a JDBC 4.0 driver 21 | * implementation against JDK 1.5. For more information, see 22 | * Eigenpedia. 23 | */ 24 | package org.eigenbase.jdbc4; 25 | 26 | // End package-info.java 27 | -------------------------------------------------------------------------------- /core/src/main/java/org/eigenbase/rel/RelCollation.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | package org.eigenbase.rel; 19 | 20 | import java.util.*; 21 | 22 | import org.eigenbase.relopt.RelTrait; 23 | 24 | /** 25 | * Description of the physical ordering of a relational expression. 26 | * 27 | *

An ordering consists of a list of one or more column ordinals and the 28 | * direction of the ordering. 29 | */ 30 | public interface RelCollation extends RelTrait { 31 | //~ Methods ---------------------------------------------------------------- 32 | 33 | /** 34 | * Returns the ordinals and directions of the columns in this ordering. 35 | */ 36 | List getFieldCollations(); 37 | } 38 | 39 | // End RelCollation.java 40 | -------------------------------------------------------------------------------- /core/src/main/java/org/eigenbase/rel/RelShuttle.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | package org.eigenbase.rel; 19 | 20 | /** 21 | * Visitor that has methods for the common logical relational expressions. 22 | */ 23 | public interface RelShuttle { 24 | RelNode visit(TableAccessRelBase scan); 25 | 26 | RelNode visit(TableFunctionRelBase scan); 27 | 28 | RelNode visit(ValuesRel values); 29 | 30 | RelNode visit(FilterRel filter); 31 | 32 | RelNode visit(ProjectRel project); 33 | 34 | RelNode visit(JoinRel join); 35 | 36 | RelNode visit(UnionRel union); 37 | 38 | RelNode visit(IntersectRel intersect); 39 | 40 | RelNode visit(MinusRel minus); 41 | 42 | RelNode visit(AggregateRel aggregate); 43 | 44 | RelNode visit(SortRel sort); 45 | 46 | RelNode visit(RelNode other); 47 | } 48 | 49 | // End RelShuttle.java 50 | -------------------------------------------------------------------------------- /core/src/main/java/org/eigenbase/rel/convert/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | 19 | /** 20 | * Defines relational expressions and rules for converting between calling 21 | * conventions. 22 | */ 23 | package org.eigenbase.rel.convert; 24 | 25 | // End package-info.java 26 | -------------------------------------------------------------------------------- /core/src/main/java/org/eigenbase/rel/jdbc/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | 19 | /** 20 | * Contains query transformation rules relating to generating SQL for 21 | * foreign JDBC databases. 22 | */ 23 | package org.eigenbase.rel.jdbc; 24 | 25 | // End package-info.java 26 | -------------------------------------------------------------------------------- /core/src/main/java/org/eigenbase/rel/metadata/MetadataFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | package org.eigenbase.rel.metadata; 19 | 20 | import org.eigenbase.rel.RelNode; 21 | 22 | /** 23 | * Source of metadata about relational expressions. 24 | * 25 | *

The metadata is typically various kinds of statistics used to estimate 26 | * costs.

27 | * 28 | *

Each kind of metadata has an interface that extends {@link Metadata} and 29 | * has a method. Some examples: {@link BuiltInMetadata.Selectivity}, 30 | * {@link BuiltInMetadata.ColumnUniqueness}.

31 | */ 32 | public interface MetadataFactory { 33 | /** Returns a metadata interface to get a particular kind of metadata 34 | * from a particular relational expression. Returns null if that kind of 35 | * metadata is not available. */ 36 | T query(RelNode rel, Class clazz); 37 | } 38 | 39 | // End MetadataFactory.java 40 | -------------------------------------------------------------------------------- /core/src/main/java/org/eigenbase/rel/metadata/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | 19 | /** 20 | * Defines metadata interfaces and utilities for relational 21 | * expressions. 22 | */ 23 | package org.eigenbase.rel.metadata; 24 | 25 | // End package-info.java 26 | -------------------------------------------------------------------------------- /core/src/main/java/org/eigenbase/rel/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | 19 | /** 20 | * Defines relational expressions. 21 | * 22 | *

Related packages and classes

23 | * 37 | */ 38 | package org.eigenbase.rel; 39 | 40 | // End package-info.java 41 | -------------------------------------------------------------------------------- /core/src/main/java/org/eigenbase/rel/rules/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | 19 | /** 20 | * Defines relational expressions.

 

21 | * 22 | *

Related packages and classes

23 | * 34 | */ 35 | package org.eigenbase.rel.rules; 36 | 37 | // End package-info.java 38 | -------------------------------------------------------------------------------- /core/src/main/java/org/eigenbase/relopt/CommonRelSubExprRule.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | package org.eigenbase.relopt; 19 | 20 | 21 | /** 22 | * A CommonRelSubExprRule is an abstract base class for rules 23 | * that are fired only on relational expressions that appear more than once 24 | * in a query tree. 25 | */ 26 | public abstract class CommonRelSubExprRule extends RelOptRule { 27 | //~ Constructors ----------------------------------------------------------- 28 | 29 | /** 30 | * Creates a CommonRelSubExprRule. 31 | * 32 | * @param operand root operand, must not be null 33 | */ 34 | public CommonRelSubExprRule(RelOptRuleOperand operand) { 35 | super(operand); 36 | } 37 | } 38 | 39 | // End CommonRelSubExprRule.java 40 | -------------------------------------------------------------------------------- /core/src/main/java/org/eigenbase/relopt/RelOptConnection.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | package org.eigenbase.relopt; 19 | 20 | /** 21 | * The planner's view of a connection to a database. 22 | * 23 | *

A connection contains a {@link RelOptSchema}, via which the query planner 24 | * can access {@link RelOptTable} objects.

25 | */ 26 | public interface RelOptConnection { 27 | /** 28 | * Returns the schema underlying this connection. 29 | */ 30 | RelOptSchema getRelOptSchema(); 31 | } 32 | 33 | // End RelOptConnection.java 34 | -------------------------------------------------------------------------------- /core/src/main/java/org/eigenbase/relopt/RelOptCostFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | package org.eigenbase.relopt; 19 | 20 | /** 21 | * Cost model for query planning. 22 | */ 23 | public interface RelOptCostFactory { 24 | /** 25 | * Creates a cost object. 26 | */ 27 | RelOptCost makeCost(double rowCount, double cpu, double io); 28 | 29 | /** 30 | * Creates a cost object representing an enormous non-infinite cost. 31 | */ 32 | RelOptCost makeHugeCost(); 33 | 34 | /** 35 | * Creates a cost object representing infinite cost. 36 | */ 37 | RelOptCost makeInfiniteCost(); 38 | 39 | /** 40 | * Creates a cost object representing a small positive cost. 41 | */ 42 | RelOptCost makeTinyCost(); 43 | 44 | /** 45 | * Creates a cost object representing zero cost. 46 | */ 47 | RelOptCost makeZeroCost(); 48 | } 49 | 50 | // End RelOptCostFactory.java 51 | -------------------------------------------------------------------------------- /core/src/main/java/org/eigenbase/relopt/hep/HepMatchOrder.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | package org.eigenbase.relopt.hep; 19 | 20 | /** 21 | * HepMatchOrder specifies the order of graph traversal when looking for rule 22 | * matches. 23 | */ 24 | public enum HepMatchOrder { 25 | /** 26 | * Match in arbitrary order. This is the default because it is the most 27 | * efficient, and most rules don't care about order. 28 | */ 29 | ARBITRARY, 30 | 31 | /** 32 | * Match from leaves up. A match attempt at a descendant precedes all match 33 | * attempts at its ancestors. 34 | */ 35 | BOTTOM_UP, 36 | 37 | /** 38 | * Match from root down. A match attempt at an ancestor always precedes all 39 | * match attempts at its descendants. 40 | */ 41 | TOP_DOWN 42 | } 43 | 44 | // End HepMatchOrder.java 45 | -------------------------------------------------------------------------------- /core/src/main/java/org/eigenbase/relopt/hep/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | 19 | /** 20 | * Provides a heuristic planner implementation for the interfaces in 21 | * {@link org.eigenbase.relopt}. 22 | */ 23 | package org.eigenbase.relopt.hep; 24 | 25 | // End package-info.java 26 | -------------------------------------------------------------------------------- /core/src/main/java/org/eigenbase/relopt/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | 19 | /** 20 | * Defines interfaces for constructing rule-based optimizers of 21 | * relational expressions. 22 | */ 23 | package org.eigenbase.relopt; 24 | 25 | // End package-info.java 26 | -------------------------------------------------------------------------------- /core/src/main/java/org/eigenbase/relopt/volcano/VolcanoPlannerPhase.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | package org.eigenbase.relopt.volcano; 19 | 20 | /** 21 | * VolcanoPlannerPhase represents the phases of operation that the {@link 22 | * VolcanoPlanner} passes through during optimization of a tree of {@link 23 | * org.eigenbase.rel.RelNode} objects. 24 | */ 25 | public enum VolcanoPlannerPhase { 26 | PRE_PROCESS_MDR, PRE_PROCESS, OPTIMIZE, CLEANUP, 27 | } 28 | 29 | // End VolcanoPlannerPhase.java 30 | -------------------------------------------------------------------------------- /core/src/main/java/org/eigenbase/reltype/RelDataTypeComparability.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | package org.eigenbase.reltype; 19 | 20 | import org.eigenbase.util.*; 21 | 22 | /** 23 | * RelDataTypeComparability is an enumeration of the categories of comparison 24 | * operators which types may support. 25 | * 26 | *

NOTE jvs 17-Mar-2005: the order of values of this enumeration is 27 | * significant (from least inclusive to most inclusive) and should not be 28 | * changed. 29 | */ 30 | public enum RelDataTypeComparability { 31 | NONE("No comparisons allowed"), 32 | UNORDERED("Only equals/not-equals allowed"), 33 | ALL("All comparisons allowed"); 34 | 35 | RelDataTypeComparability(String description) { 36 | Util.discard(description); 37 | } 38 | } 39 | 40 | // End RelDataTypeComparability.java 41 | -------------------------------------------------------------------------------- /core/src/main/java/org/eigenbase/reltype/RelDataTypeFamily.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | package org.eigenbase.reltype; 19 | 20 | /** 21 | * RelDataTypeFamily represents a family of related types. The specific criteria 22 | * for membership in a type family are type-system dependent. 23 | */ 24 | public interface RelDataTypeFamily { 25 | } 26 | 27 | // End RelDataTypeFamily.java 28 | -------------------------------------------------------------------------------- /core/src/main/java/org/eigenbase/reltype/RelProtoDataType.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | package org.eigenbase.reltype; 19 | 20 | import net.hydromatic.linq4j.function.Function1; 21 | 22 | /** 23 | * Can be converted into a {@link RelDataType} given a 24 | * {@link org.eigenbase.reltype.RelDataTypeFactory}. 25 | * 26 | * @see org.eigenbase.reltype.RelDataTypeImpl#proto 27 | */ 28 | public interface RelProtoDataType 29 | extends Function1 { 30 | } 31 | 32 | // End RelProtoDataType.java 33 | -------------------------------------------------------------------------------- /core/src/main/java/org/eigenbase/reltype/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | 19 | /** 20 | * Defines a type system for relational expressions. 21 | */ 22 | package org.eigenbase.reltype; 23 | 24 | // End package-info.java 25 | -------------------------------------------------------------------------------- /core/src/main/java/org/eigenbase/resource/Feature.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | package org.eigenbase.resource; 19 | 20 | import java.lang.reflect.Method; 21 | import java.util.Locale; 22 | 23 | import org.eigenbase.util.EigenbaseContextException; 24 | 25 | /** SQL language feature. Expressed as the exception that would be thrown if it 26 | * were used while disabled. */ 27 | public class Feature 28 | extends Resources.ExInstWithCause { 29 | public Feature(String base, Locale locale, Method method, Object... args) { 30 | super(base, locale, method, args); 31 | } 32 | } 33 | 34 | // End Feature.java 35 | -------------------------------------------------------------------------------- /core/src/main/java/org/eigenbase/resource/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | 19 | /** 20 | * Defines resources used for Eigenbase internationalization. 21 | */ 22 | package org.eigenbase.resource; 23 | 24 | // End package-info.java 25 | -------------------------------------------------------------------------------- /core/src/main/java/org/eigenbase/rex/RexAction.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | package org.eigenbase.rex; 19 | 20 | /** 21 | * A RexAction is called when a {@link RexPattern} finds a match. 22 | * It yields a {@link RexNode} by substituting the matching tokens. 23 | */ 24 | public interface RexAction { 25 | //~ Methods ---------------------------------------------------------------- 26 | 27 | void onMatch(RexNode[] tokens); 28 | } 29 | 30 | // End RexAction.java 31 | -------------------------------------------------------------------------------- /core/src/main/java/org/eigenbase/rex/RexPattern.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | package org.eigenbase.rex; 19 | 20 | /** 21 | * A RexPattern represents an expression with holes in it. The 22 | * {@link #match} method tests whether a given expression matches the pattern. 23 | */ 24 | public interface RexPattern { 25 | //~ Methods ---------------------------------------------------------------- 26 | 27 | /** 28 | * Calls action for every combination of tokens for which this 29 | * pattern matches. 30 | */ 31 | void match( 32 | RexNode ptree, 33 | RexAction action); 34 | } 35 | 36 | // End RexPattern.java 37 | -------------------------------------------------------------------------------- /core/src/main/java/org/eigenbase/rex/RexSqlConvertlet.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | package org.eigenbase.rex; 19 | 20 | import org.eigenbase.sql.*; 21 | 22 | /** 23 | * Converts a {@link RexNode} expression into a {@link SqlNode} expression. 24 | */ 25 | public interface RexSqlConvertlet { 26 | //~ Methods ---------------------------------------------------------------- 27 | 28 | /** 29 | * Converts a {@link RexCall} to a {@link SqlNode} expression. 30 | * 31 | * @param converter to use in translating 32 | * @param call RexCall to translate 33 | * @return SqlNode, or null if translation was unavailable 34 | */ 35 | SqlNode convertCall( 36 | RexToSqlNodeConverter converter, 37 | RexCall call); 38 | } 39 | 40 | // End RexSqlConvertlet.java 41 | -------------------------------------------------------------------------------- /core/src/main/java/org/eigenbase/rex/RexSqlConvertletTable.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | package org.eigenbase.rex; 19 | 20 | /** 21 | * Collection of {@link RexSqlConvertlet}s. 22 | */ 23 | public interface RexSqlConvertletTable { 24 | //~ Methods ---------------------------------------------------------------- 25 | 26 | /** 27 | * Returns the convertlet applicable to a given expression. 28 | */ 29 | RexSqlConvertlet get(RexCall call); 30 | } 31 | 32 | // End RexSqlConvertletTable.java 33 | -------------------------------------------------------------------------------- /core/src/main/java/org/eigenbase/runtime/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | 19 | /** 20 | * Defines classes used by generated Eigenbase classes at runtime. 21 | */ 22 | package org.eigenbase.runtime; 23 | 24 | // End package-info.java 25 | -------------------------------------------------------------------------------- /core/src/main/java/org/eigenbase/sarg/SargBoundType.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | package org.eigenbase.sarg; 19 | 20 | /** 21 | * SargBoundType defines the possible endpoint boundaries (upper or lower). 22 | */ 23 | public enum SargBoundType { 24 | LOWER, 25 | 26 | UPPER 27 | } 28 | 29 | // End SargBoundType.java 30 | -------------------------------------------------------------------------------- /core/src/main/java/org/eigenbase/sarg/SargSetOperator.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | package org.eigenbase.sarg; 19 | 20 | /** 21 | * SargSetOperator defines the supported set operators which can be used to 22 | * combine instances of {@link SargExpr}. 23 | */ 24 | public enum SargSetOperator { 25 | /** 26 | * Set intersection over any number of children (no children → universal 27 | * set). 28 | */ 29 | INTERSECTION, 30 | 31 | /** 32 | * Set union over any number of children (no children → empty set). 33 | */ 34 | UNION, 35 | 36 | /** 37 | * Set complement over exactly one child. 38 | */ 39 | COMPLEMENT 40 | } 41 | 42 | // End SargSetOperator.java 43 | -------------------------------------------------------------------------------- /core/src/main/java/org/eigenbase/sarg/SargStrictness.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | package org.eigenbase.sarg; 19 | 20 | /** 21 | * Defines the boundary strictness of an endpoint: either open (either strictly 22 | * less than or greater than) or closed (exactly equal). 23 | */ 24 | public enum SargStrictness { 25 | OPEN, 26 | 27 | CLOSED 28 | } 29 | 30 | // End SargStrictness.java 31 | -------------------------------------------------------------------------------- /core/src/main/java/org/eigenbase/sarg/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | 19 | /** 20 | * Provides a class library for representing arguments to index searches, 21 | * also known as sargs. Unit tests for this package are in 22 | * {@code org.eigenbase.test.SargTest}. 23 | */ 24 | package org.eigenbase.sarg; 25 | 26 | // End package-info.java 27 | -------------------------------------------------------------------------------- /core/src/main/java/org/eigenbase/sql/SqlAccessEnum.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | package org.eigenbase.sql; 19 | 20 | /** 21 | * Enumeration representing different access types 22 | */ 23 | public enum SqlAccessEnum { 24 | SELECT, UPDATE, INSERT, DELETE; 25 | } 26 | 27 | // End SqlAccessEnum.java 28 | -------------------------------------------------------------------------------- /core/src/main/java/org/eigenbase/sql/SqlInsertKeyword.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | package org.eigenbase.sql; 19 | 20 | /** 21 | * Defines the keywords which can occur immediately after the "INSERT" keyword. 22 | * Standard SQL has no such keywords. This enumeration exists only to allow 23 | * extension projects to define them. 24 | */ 25 | public enum SqlInsertKeyword implements SqlLiteral.SqlSymbol { 26 | } 27 | 28 | // End SqlInsertKeyword.java 29 | -------------------------------------------------------------------------------- /core/src/main/java/org/eigenbase/sql/SqlOperandCountRange.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | package org.eigenbase.sql; 19 | 20 | 21 | /** 22 | * A class that describes how many operands an operator can take. 23 | */ 24 | public interface SqlOperandCountRange { 25 | /** 26 | * Returns whether {@code count} is a valid number of operands. 27 | */ 28 | boolean isValidCount(int count); 29 | 30 | /** 31 | * Returns an lower bound. -1 if there is no lower bound. 32 | */ 33 | int getMin(); 34 | 35 | /** 36 | * Returns an upper bound. -1 if there is no upper bound. 37 | */ 38 | int getMax(); 39 | 40 | } 41 | 42 | // End SqlOperandCountRange.java 43 | -------------------------------------------------------------------------------- /core/src/main/java/org/eigenbase/sql/SqlSelectKeyword.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | package org.eigenbase.sql; 19 | 20 | import org.eigenbase.sql.parser.SqlParserPos; 21 | 22 | /** 23 | * Defines the keywords which can occur immediately after the "SELECT" keyword. 24 | */ 25 | public enum SqlSelectKeyword implements SqlLiteral.SqlSymbol { 26 | DISTINCT, 27 | ALL; 28 | 29 | /** 30 | * Creates a parse-tree node representing an occurrence of this keyword 31 | * at a particular position in the parsed text. 32 | */ 33 | public SqlLiteral symbol(SqlParserPos pos) { 34 | return SqlLiteral.createSymbol(this, pos); 35 | } 36 | } 37 | 38 | // End SqlSelectKeyword.java 39 | -------------------------------------------------------------------------------- /core/src/main/java/org/eigenbase/sql/SqlValuesOperator.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | package org.eigenbase.sql; 19 | 20 | /** 21 | * The VALUES operator. 22 | */ 23 | public class SqlValuesOperator extends SqlSpecialOperator { 24 | //~ Constructors ----------------------------------------------------------- 25 | 26 | public SqlValuesOperator() { 27 | super("VALUES", SqlKind.VALUES); 28 | } 29 | 30 | //~ Methods ---------------------------------------------------------------- 31 | 32 | public void unparse( 33 | SqlWriter writer, 34 | SqlCall call, 35 | int leftPrec, 36 | int rightPrec) { 37 | final SqlWriter.Frame frame = writer.startList("VALUES", ""); 38 | for (SqlNode operand : call.getOperandList()) { 39 | writer.sep(","); 40 | operand.unparse(writer, 0, 0); 41 | } 42 | writer.endList(frame); 43 | } 44 | } 45 | 46 | // End SqlValuesOperator.java 47 | -------------------------------------------------------------------------------- /core/src/main/java/org/eigenbase/sql/advise/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | 19 | /** 20 | * Provides hints and corrections for editing SQL statements. 21 | * 22 | *

The SQL statement might be partially-formed SQL statement or 23 | * invalid. It is edited in a SQL editor user-interface.

24 | * 25 | *

The advisor uses the validation and parser framework set up in 26 | * org.eigenbase.sql.validate package. 27 | */ 28 | package org.eigenbase.sql.advise; 29 | 30 | // End package-info.java 31 | -------------------------------------------------------------------------------- /core/src/main/java/org/eigenbase/sql/fun/SqlArrayQueryConstructor.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | package org.eigenbase.sql.fun; 19 | 20 | import org.eigenbase.sql.*; 21 | import org.eigenbase.sql.validate.*; 22 | 23 | /** 24 | * Definition of the SQL:2003 standard ARRAY query constructor, 25 | * ARRAY (<query>). 26 | */ 27 | public class SqlArrayQueryConstructor extends SqlMultisetQueryConstructor { 28 | //~ Constructors ----------------------------------------------------------- 29 | 30 | public SqlArrayQueryConstructor() { 31 | super("ARRAY", SqlKind.MAP_QUERY_CONSTRUCTOR); 32 | } 33 | } 34 | 35 | // End SqlArrayQueryConstructor.java 36 | -------------------------------------------------------------------------------- /core/src/main/java/org/eigenbase/sql/fun/SqlMapQueryConstructor.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | package org.eigenbase.sql.fun; 19 | 20 | import org.eigenbase.sql.SqlKind; 21 | 22 | /** 23 | * Definition of the MAP query constructor, 24 | * MAP (<query>). 25 | * 26 | *

Like the MAP type, not standard SQL.

27 | */ 28 | public class SqlMapQueryConstructor extends SqlMultisetQueryConstructor { 29 | //~ Constructors ----------------------------------------------------------- 30 | 31 | public SqlMapQueryConstructor() { 32 | super("MAP", SqlKind.MAP_QUERY_CONSTRUCTOR); 33 | } 34 | } 35 | 36 | // End SqlMapQueryConstructor.java 37 | -------------------------------------------------------------------------------- /core/src/main/java/org/eigenbase/sql/fun/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | 19 | /** 20 | * Defines the set of standard SQL row-level functions and 21 | * operators. 22 | * 23 | *

The standard set of row-level functions and operators are declared in 24 | * class {@link org.eigenbase.sql.fun.SqlStdOperatorTable}. Anonymous inner 25 | * classes within that table are allowed only for specifying an operator's test 26 | * function; if other custom code is needed for an operator, it should be 27 | * implemented in a top-level class within this package instead. Operators 28 | * which are not row-level (e.g. select and join) should be defined in package 29 | * {@link org.eigenbase.sql} instead.

30 | */ 31 | package org.eigenbase.sql.fun; 32 | 33 | // End package-info.java 34 | -------------------------------------------------------------------------------- /core/src/main/java/org/eigenbase/sql/parser/SqlParserImplFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | package org.eigenbase.sql.parser; 19 | 20 | import java.io.Reader; 21 | 22 | /** 23 | * Factory for {@link org.eigenbase.sql.parser.SqlAbstractParserImpl} objects. 24 | * 25 | *

A parser factory allows you to include a custom parser in 26 | * {@link net.hydromatic.optiq.tools.Planner} created through 27 | * {@link net.hydromatic.optiq.tools.Frameworks}.

28 | */ 29 | public interface SqlParserImplFactory { 30 | 31 | /** 32 | * Get the underlying parser implementation. 33 | * 34 | * @return {@link SqlAbstractParserImpl} object. 35 | */ 36 | SqlAbstractParserImpl getParser(Reader stream); 37 | } 38 | -------------------------------------------------------------------------------- /core/src/main/java/org/eigenbase/sql/parser/impl/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | 19 | /** 20 | * Contains generated code for the 21 | * {@link org.eigenbase.sql.parser Eigenbase SQL parser}. 22 | */ 23 | package org.eigenbase.sql.parser.impl; 24 | 25 | // End package-info.java 26 | -------------------------------------------------------------------------------- /core/src/main/java/org/eigenbase/sql/parser/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | 19 | /** 20 | * Provides a SQL parser. 21 | */ 22 | package org.eigenbase.sql.parser; 23 | 24 | // End package-info.java 25 | -------------------------------------------------------------------------------- /core/src/main/java/org/eigenbase/sql/pretty/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | 19 | /** 20 | * Provides a pretty-printer for SQL statements. 21 | */ 22 | package org.eigenbase.sql.pretty; 23 | 24 | // End package-info.java 25 | -------------------------------------------------------------------------------- /core/src/main/java/org/eigenbase/sql/type/OperandsTypeChecking.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | package org.eigenbase.sql.type; 19 | 20 | import org.eigenbase.reltype.*; 21 | import org.eigenbase.sql.*; 22 | 23 | /** 24 | * Strategies to check for allowed operand types of an operator call. 25 | */ 26 | public abstract class OperandsTypeChecking { 27 | } 28 | 29 | // End OperandsTypeChecking.java 30 | -------------------------------------------------------------------------------- /core/src/main/java/org/eigenbase/sql/type/SqlOperandTypeInference.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | package org.eigenbase.sql.type; 19 | 20 | import org.eigenbase.reltype.*; 21 | import org.eigenbase.sql.*; 22 | 23 | /** 24 | * Strategy to infer unknown types of the operands of an operator call. 25 | */ 26 | public interface SqlOperandTypeInference { 27 | //~ Methods ---------------------------------------------------------------- 28 | 29 | /** 30 | * Infers any unknown operand types. 31 | * 32 | * @param callBinding description of the call being analyzed 33 | * @param returnType the type known or inferred for the result of the call 34 | * @param operandTypes receives the inferred types for all operands 35 | */ 36 | void inferOperandTypes( 37 | SqlCallBinding callBinding, 38 | RelDataType returnType, 39 | RelDataType[] operandTypes); 40 | } 41 | 42 | // End SqlOperandTypeInference.java 43 | -------------------------------------------------------------------------------- /core/src/main/java/org/eigenbase/sql/type/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | 19 | /** 20 | * SQL type system. 21 | */ 22 | package org.eigenbase.sql.type; 23 | 24 | // End package-info.java 25 | -------------------------------------------------------------------------------- /core/src/main/java/org/eigenbase/sql/util/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | 19 | /** 20 | * Utility classes for the SQL object model, parsing, and validation. 21 | */ 22 | package org.eigenbase.sql.util; 23 | 24 | // End package-info.java 25 | -------------------------------------------------------------------------------- /core/src/main/java/org/eigenbase/sql/validate/SqlMoniker.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | package org.eigenbase.sql.validate; 19 | 20 | import java.util.List; 21 | 22 | import org.eigenbase.sql.*; 23 | 24 | /** 25 | * An interface of an object identifier that represents a SqlIdentifier 26 | */ 27 | public interface SqlMoniker { 28 | //~ Methods ---------------------------------------------------------------- 29 | 30 | /** 31 | * Returns the type of object referred to by this moniker. Never null. 32 | */ 33 | SqlMonikerType getType(); 34 | 35 | /** 36 | * Returns the array of component names. 37 | */ 38 | List getFullyQualifiedNames(); 39 | 40 | /** 41 | * Creates a {@link SqlIdentifier} containing the fully-qualified name. 42 | */ 43 | SqlIdentifier toIdentifier(); 44 | 45 | String id(); 46 | } 47 | 48 | // End SqlMoniker.java 49 | -------------------------------------------------------------------------------- /core/src/main/java/org/eigenbase/sql/validate/SqlMonikerComparator.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | package org.eigenbase.sql.validate; 19 | 20 | import java.util.*; 21 | 22 | /** 23 | * A general-purpose implementation of {@link Comparator} to compare {@link 24 | * SqlMoniker} values. 25 | */ 26 | public class SqlMonikerComparator implements Comparator { 27 | //~ Methods ---------------------------------------------------------------- 28 | 29 | public int compare(SqlMoniker m1, SqlMoniker m2) { 30 | if (m1.getType().ordinal() > m2.getType().ordinal()) { 31 | return 1; 32 | } else if (m1.getType().ordinal() < m2.getType().ordinal()) { 33 | return -1; 34 | } else { 35 | return m1.toString().compareTo(m2.toString()); 36 | } 37 | } 38 | } 39 | 40 | // End SqlMonikerComparator.java 41 | -------------------------------------------------------------------------------- /core/src/main/java/org/eigenbase/sql/validate/SqlMonikerType.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | package org.eigenbase.sql.validate; 19 | 20 | /** 21 | * An enumeration of moniker types. 22 | * 23 | *

Used in {@link SqlMoniker}. 24 | */ 25 | public enum SqlMonikerType { 26 | COLUMN, TABLE, VIEW, SCHEMA, REPOSITORY, FUNCTION, KEYWORD 27 | } 28 | 29 | // End SqlMonikerType.java 30 | -------------------------------------------------------------------------------- /core/src/main/java/org/eigenbase/sql/validate/SqlValidatorTable.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | package org.eigenbase.sql.validate; 19 | 20 | import java.util.List; 21 | 22 | import org.eigenbase.reltype.*; 23 | import org.eigenbase.sql.*; 24 | 25 | /** 26 | * Supplies a {@link SqlValidator} with the metadata for a table. 27 | * 28 | * @see SqlValidatorCatalogReader 29 | */ 30 | public interface SqlValidatorTable { 31 | //~ Methods ---------------------------------------------------------------- 32 | 33 | RelDataType getRowType(); 34 | 35 | List getQualifiedName(); 36 | 37 | /** 38 | * Returns whether a given column is monotonic. 39 | */ 40 | SqlMonotonicity getMonotonicity(String columnName); 41 | 42 | /** 43 | * Returns the access type of the table 44 | */ 45 | SqlAccessType getAllowedAccess(); 46 | } 47 | 48 | // End SqlValidatorTable.java 49 | -------------------------------------------------------------------------------- /core/src/main/java/org/eigenbase/sql/validate/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | 19 | /** 20 | * SQL validation. 21 | */ 22 | package org.eigenbase.sql.validate; 23 | 24 | // End package-info.java 25 | -------------------------------------------------------------------------------- /core/src/main/java/org/eigenbase/sql2rel/SqlRexConvertlet.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | package org.eigenbase.sql2rel; 19 | 20 | import org.eigenbase.rex.*; 21 | import org.eigenbase.sql.*; 22 | 23 | /** 24 | * Thunk which converts a {@link SqlNode} expression into a {@link RexNode} 25 | * expression. 26 | */ 27 | public interface SqlRexConvertlet { 28 | //~ Methods ---------------------------------------------------------------- 29 | 30 | RexNode convertCall( 31 | SqlRexContext cx, 32 | SqlCall call); 33 | } 34 | 35 | // End SqlRexConvertlet.java 36 | -------------------------------------------------------------------------------- /core/src/main/java/org/eigenbase/sql2rel/SqlRexConvertletTable.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | package org.eigenbase.sql2rel; 19 | 20 | import org.eigenbase.sql.*; 21 | 22 | /** 23 | * Collection of {@link SqlRexConvertlet}s. 24 | */ 25 | public interface SqlRexConvertletTable { 26 | //~ Methods ---------------------------------------------------------------- 27 | 28 | /** 29 | * Returns the convertlet applicable to a given expression. 30 | */ 31 | SqlRexConvertlet get(SqlCall call); 32 | } 33 | 34 | // End SqlRexConvertletTable.java 35 | -------------------------------------------------------------------------------- /core/src/main/java/org/eigenbase/sql2rel/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | 19 | /** 20 | * Translates a SQL parse tree to relational expression. 21 | */ 22 | package org.eigenbase.sql2rel; 23 | 24 | // End package-info.java 25 | -------------------------------------------------------------------------------- /core/src/main/java/org/eigenbase/stat/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | 19 | /** 20 | * Defines interfaces related to statistics about data sets produced by 21 | * relational expressions. 22 | */ 23 | package org.eigenbase.stat; 24 | 25 | // End package-info.java 26 | -------------------------------------------------------------------------------- /core/src/main/java/org/eigenbase/trace/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | 19 | /** 20 | * Tracing services. 21 | */ 22 | package org.eigenbase.trace; 23 | 24 | // End package-info.java 25 | -------------------------------------------------------------------------------- /core/src/main/java/org/eigenbase/util/ClosableAllocation.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | package org.eigenbase.util; 19 | 20 | /** 21 | * ClosableAllocation represents an object which requires a call in order to 22 | * release resources early rather than waiting for finalization. 23 | */ 24 | public interface ClosableAllocation { 25 | //~ Methods ---------------------------------------------------------------- 26 | 27 | /** 28 | * Closes this object. 29 | */ 30 | void closeAllocation(); 31 | } 32 | 33 | // End ClosableAllocation.java 34 | -------------------------------------------------------------------------------- /core/src/main/java/org/eigenbase/util/ClosableAllocationOwner.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | package org.eigenbase.util; 19 | 20 | /** 21 | * ClosableAllocationOwner represents an object which can take ownership of 22 | * ClosableAllocations and guarantee that they will be cleaned up correctly when 23 | * its own closeAllocation() is called. 24 | */ 25 | public interface ClosableAllocationOwner extends ClosableAllocation { 26 | //~ Methods ---------------------------------------------------------------- 27 | 28 | /** 29 | * Assigns ownership of a ClosableAllocation to this owner. 30 | * 31 | * @param allocation the ClosableAllocation to take over 32 | */ 33 | void addAllocation(ClosableAllocation allocation); 34 | } 35 | 36 | // End ClosableAllocationOwner.java 37 | -------------------------------------------------------------------------------- /core/src/main/java/org/eigenbase/util/ControlFlowException.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | package org.eigenbase.util; 19 | 20 | /** 21 | * Exception intended to be used for control flow, as opposed to the usual 22 | * use of exceptions which is to signal an error condition. 23 | * 24 | *

{@code ControlFlowException} does not populate its own stack trace, which 25 | * makes instantiating one of these (or a sub-class) more efficient.

26 | */ 27 | public class ControlFlowException extends RuntimeException { 28 | @Override public Throwable fillInStackTrace() { 29 | return this; 30 | } 31 | } 32 | 33 | // End ControlFlowException.java 34 | -------------------------------------------------------------------------------- /core/src/main/java/org/eigenbase/util/ReflectiveVisitor.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | package org.eigenbase.util; 19 | 20 | /** 21 | * Object which can be a target for a reflective visitation (see {@link 22 | * ReflectUtil#invokeVisitor(ReflectiveVisitor, Object, Class, String)}. 23 | * 24 | *

This is a tagging interface: it has no methods, and is not even required 25 | * in order to use reflective visitation, but serves to advise users of the 26 | * class of the intended use of the class and refer them to auxilliary classes. 27 | */ 28 | public interface ReflectiveVisitor { 29 | } 30 | 31 | // End ReflectiveVisitor.java 32 | -------------------------------------------------------------------------------- /core/src/main/java/org/eigenbase/util/Static.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | package org.eigenbase.util; 19 | 20 | import org.eigenbase.resource.EigenbaseNewResource; 21 | import org.eigenbase.resource.Resources; 22 | 23 | /** 24 | * Definitions of objects to be statically imported. 25 | * 26 | *

Developers: Give careful consideration before including an object in this 27 | * class. 28 | * Pros: Code that uses these objects will be terser. 29 | * Cons: Namespace pollution, 30 | * code that is difficult to understand (a general problem with static imports), 31 | * potential cyclic initialization.

32 | */ 33 | public abstract class Static { 34 | private Static() {} 35 | 36 | /** Resources. */ 37 | public static final EigenbaseNewResource RESOURCE = 38 | Resources.create("org.eigenbase.resource.EigenbaseResource", 39 | EigenbaseNewResource.class); 40 | } 41 | 42 | // End Static.java 43 | -------------------------------------------------------------------------------- /core/src/main/java/org/eigenbase/util/mapping/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | 19 | /** 20 | * Support for algebraic maps. 21 | */ 22 | package org.eigenbase.util.mapping; 23 | 24 | // End package-info.java 25 | -------------------------------------------------------------------------------- /core/src/main/java/org/eigenbase/util/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | /** 19 | * Provides utility classes. 20 | */ 21 | package org.eigenbase.util; 22 | 23 | 24 | // End package-info.java 25 | -------------------------------------------------------------------------------- /core/src/main/java/org/eigenbase/util14/EigenbaseParserException.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | package org.eigenbase.util14; 19 | 20 | /** 21 | * This is a tagging interface to allow a {@link 22 | * org.eigenbase.sql.parser.SqlParseException} to be identified without adding a 23 | * dependency on it from client-side code. 24 | */ 25 | public interface EigenbaseParserException { 26 | } 27 | 28 | // End EigenbaseParserException.java 29 | -------------------------------------------------------------------------------- /core/src/main/java/org/eigenbase/util14/EigenbaseValidatorException.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | package org.eigenbase.util14; 19 | 20 | /** 21 | * This is a tagging interface to allow {@link 22 | * org.eigenbase.sql.validate.SqlValidatorException} to be identified without 23 | * adding a dependency on it from client-side code. 24 | */ 25 | public interface EigenbaseValidatorException { 26 | } 27 | 28 | // End EigenbaseValidatorException.java 29 | -------------------------------------------------------------------------------- /core/src/main/java/org/eigenbase/util14/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | 19 | /** 20 | * Provides utility classes for use from code which must remain 21 | * source-compatible with JDK 1.4. 22 | */ 23 | package org.eigenbase.util14; 24 | 25 | // End package-info.java 26 | -------------------------------------------------------------------------------- /core/src/main/resources/META-INF/services/java.sql.Driver: -------------------------------------------------------------------------------- 1 | net.hydromatic.optiq.jdbc.Driver -------------------------------------------------------------------------------- /core/src/main/resources/version/net-hydromatic-optiq-jdbc.properties: -------------------------------------------------------------------------------- 1 | driver.name=Optiq JDBC Driver 2 | driver.version=${pom.version} 3 | product.name=Optiq 4 | product.version=${pom.version} 5 | jdbc.compliant=true 6 | driver.version.major=${version.major} 7 | driver.version.minor=${version.minor} 8 | database.version.major=${version.major} 9 | database.version.minor=${version.minor} 10 | build.timestamp=${build.timestamp} 11 | -------------------------------------------------------------------------------- /core/src/test/java/net/hydromatic/optiq/test/OptiqSqlOperatorTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | package net.hydromatic.optiq.test; 19 | 20 | import net.hydromatic.optiq.jdbc.OptiqConnection; 21 | 22 | import org.eigenbase.sql.test.SqlOperatorBaseTest; 23 | import org.eigenbase.sql.test.SqlTester; 24 | 25 | /** 26 | * Embodiment of {@link org.eigenbase.sql.test.SqlOperatorBaseTest} 27 | * that generates SQL statements and executes them using Optiq. 28 | */ 29 | public class OptiqSqlOperatorTest extends SqlOperatorBaseTest { 30 | private static SqlTester getHrTester() { 31 | try { 32 | OptiqConnection connection = OptiqAssert.getConnection("hr"); 33 | return tester(connection); 34 | } catch (Exception e) { 35 | throw new RuntimeException(e); 36 | } 37 | } 38 | 39 | public OptiqSqlOperatorTest() { 40 | super(false, getHrTester()); 41 | } 42 | } 43 | 44 | // End OptiqSqlOperatorTest.java 45 | -------------------------------------------------------------------------------- /core/src/test/java/net/hydromatic/optiq/test/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | 19 | /** 20 | * Tests for Optiq. 21 | */ 22 | package net.hydromatic.optiq.test; 23 | 24 | // End package-info.java 25 | -------------------------------------------------------------------------------- /core/src/test/java/org/eigenbase/sql/parser/SqlUnParserTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | package org.eigenbase.sql.parser; 19 | 20 | /** 21 | * Extension to {@link SqlParserTest} which ensures that every expression can 22 | * un-parse successfully. 23 | */ 24 | public class SqlUnParserTest extends SqlParserTest { 25 | //~ Constructors ----------------------------------------------------------- 26 | 27 | public SqlUnParserTest() { 28 | } 29 | 30 | //~ Methods ---------------------------------------------------------------- 31 | 32 | protected Tester getTester() { 33 | return new UnparsingTesterImpl(); 34 | } 35 | } 36 | 37 | // End SqlUnParserTest.java 38 | -------------------------------------------------------------------------------- /core/src/test/java/org/eigenbase/sql/test/SqlOperatorTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | package org.eigenbase.sql.test; 19 | 20 | import org.eigenbase.sql.validate.*; 21 | import org.eigenbase.test.*; 22 | 23 | /** 24 | * Concrete subclass of {@link SqlOperatorBaseTest} which checks against 25 | * a {@link SqlValidator}. Tests that involve execution trivially succeed. 26 | */ 27 | public class SqlOperatorTest extends SqlOperatorBaseTest { 28 | private static final SqlTester DEFAULT_TESTER = 29 | (SqlTester) new SqlValidatorTestCase().getTester(); 30 | 31 | /** 32 | * Creates a SqlOperatorTest. 33 | */ 34 | public SqlOperatorTest() { 35 | super(false, DEFAULT_TESTER); 36 | } 37 | } 38 | 39 | // End SqlOperatorTest.java 40 | -------------------------------------------------------------------------------- /core/src/test/java/org/eigenbase/sql/test/SqlTestFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | package org.eigenbase.sql.test; 19 | 20 | import org.eigenbase.sql.SqlOperatorTable; 21 | import org.eigenbase.sql.advise.SqlAdvisor; 22 | import org.eigenbase.sql.parser.SqlParser; 23 | import org.eigenbase.sql.validate.SqlValidator; 24 | import org.eigenbase.sql.validate.SqlValidatorWithHints; 25 | 26 | /** 27 | * Creates the objects needed to run a SQL parsing or validation test. 28 | * 29 | * @see org.eigenbase.sql.test.SqlTester 30 | */ 31 | public interface SqlTestFactory { 32 | SqlOperatorTable createOperatorTable(); 33 | SqlParser createParser(SqlTestFactory factory, String sql); 34 | SqlValidator getValidator(SqlTestFactory factory); 35 | SqlAdvisor createAdvisor(SqlValidatorWithHints validator); 36 | Object get(String name); 37 | } 38 | 39 | // End SqlTestFactory.java 40 | -------------------------------------------------------------------------------- /core/src/test/java/org/eigenbase/sql/test/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | 19 | /** 20 | * Regression tests for the SQL model. 21 | */ 22 | package org.eigenbase.sql.test; 23 | 24 | // End package-info.java 25 | -------------------------------------------------------------------------------- /core/src/test/java/org/eigenbase/test/concurrent/mtsql: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | # $Id$ 3 | # Command-line tool to run an mtsql script. 4 | # Usage: mtlsql [-vg] -u URL -d DRIVER [-n USER] [-p PASSWORD] SCRIPT [SCRIPT]... 5 | # -u URL : sets the server connected to; argument is a jdbc URL. Required. 6 | # -d DRIVER : specifies the jdbc driver class. Required. 7 | # -v : print sql results to stdout 8 | # -g : print some trace messages to stderr 9 | 10 | # TODO: handle -g and -d here, not in java code. 11 | 12 | JFLAGS="-client -ea -esa -Djava.util.logging.config.file=$(dirname $0)/mtsql.loggers" 13 | java $JFLAGS -cp $CLASSPATH org.eigenbase.test.concurrent.ConcurrentTestCommandScript "$@" 14 | exit $? 15 | -------------------------------------------------------------------------------- /core/src/test/java/org/eigenbase/test/concurrent/mtsql.loggers: -------------------------------------------------------------------------------- 1 | handlers=java.util.logging.ConsoleHandler 2 | .level=WARNING 3 | 4 | -------------------------------------------------------------------------------- /core/src/test/java/org/eigenbase/test/concurrent/test.mtsql: -------------------------------------------------------------------------------- 1 | -- for manual testing of the tool 'mtsql' 2 | -- expects to connect to farrago 3 | -- $Id$ 4 | 5 | @var N=7 6 | @var S=bagel bag 7 | @var HOSTNAME 8 | @var USER 9 | @var WHO=$USER@$HOSTNAME 10 | @var RecursiveVar=$N $S $HOSTNAME $WHO 11 | 12 | @setup 13 | create schema foo; 14 | create view foo.crossview as ( 15 | select * from sales.depts x 16 | cross join sales.emps y 17 | cross join sales.emps z 18 | ); 19 | @end 20 | 21 | @cleanup 22 | drop schema foo cascade; 23 | @end 24 | 25 | @thread reader 26 | @shell pwd 27 | @shell echo mtsql* 28 | @shell hostname; whoami 29 | @shell head -1 < package.html | cat | cat > foo; cat foo 30 | @echo $$N is $N and $$S is $S. 31 | @echo The $$HOSTNAME is $HOSTNAME. 32 | @echo The $$HOSTNAME is $HOSTNAME, ${HOSTNAME}, "$HOSTNAME", "${HOSTNAME}", '$HOSTNAME', '${HOSTNAME}'. 33 | @echo The $$HOSTNAME is "$HOSTNAME, ${HOSTNAME}". 34 | @echo $$WHO is $WHO 35 | @echo $$RecursiveVar is $RecursiveVar 36 | 37 | values (1,2,3); 38 | values (4, '$HOSTNAME', '$USER@$HOSTNAME'); 39 | values ($N, '$S'); 40 | select * from sales.depts; 41 | @sync 42 | @end 43 | 44 | @thread printer 45 | @prepare select * from foo.crossview; 46 | @sync 47 | 48 | @echo printing all 49 | @print all 50 | @fetch 51 | 52 | @echo printing none 53 | @print none 54 | @fetch 55 | 56 | @echo printing every 5th row 57 | @print count every 5 58 | @fetch 59 | 60 | @echo printing every ${N}th row 61 | @print count every $N 62 | @fetch 63 | 64 | @echo printing every other row 65 | @print count every 2 66 | @fetch 67 | 68 | @close 69 | @end 70 | 71 | 72 | -------------------------------------------------------------------------------- /core/src/test/java/org/eigenbase/test/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | 19 | /** 20 | * Eigenbase regression tests. 21 | */ 22 | package org.eigenbase.test; 23 | 24 | // End package-info.java 25 | -------------------------------------------------------------------------------- /mongodb/src/main/java/net/hydromatic/optiq/impl/mongodb/MongoSchemaFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | package net.hydromatic.optiq.impl.mongodb; 19 | 20 | import net.hydromatic.optiq.*; 21 | 22 | import java.util.Map; 23 | 24 | /** 25 | * Factory that creates a {@link MongoSchema}. 26 | * 27 | *

Allows a custom schema to be included in a model.json file.

28 | */ 29 | @SuppressWarnings("UnusedDeclaration") 30 | public class MongoSchemaFactory implements SchemaFactory { 31 | // public constructor, per factory contract 32 | public MongoSchemaFactory() { 33 | } 34 | 35 | public Schema create(SchemaPlus parentSchema, String name, 36 | Map operand) { 37 | Map map = (Map) operand; 38 | String host = (String) map.get("host"); 39 | String database = (String) map.get("database"); 40 | return new MongoSchema(host, database); 41 | } 42 | } 43 | 44 | // End MongoSchemaFactory.java 45 | -------------------------------------------------------------------------------- /mongodb/src/main/java/net/hydromatic/optiq/impl/mongodb/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | 19 | /** 20 | * Query provider based on a MongoDB database. 21 | */ 22 | package net.hydromatic.optiq.impl.mongodb; 23 | 24 | // End package-info.java 25 | -------------------------------------------------------------------------------- /mongodb/src/test/java/net/hydromatic/optiq/test/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | 19 | /** 20 | * Provides utility classes. 21 | */ 22 | package org.eigenbase.util; 23 | 24 | // End package-info.java 25 | -------------------------------------------------------------------------------- /mongodb/src/test/resources/mongo-zips-model.json: -------------------------------------------------------------------------------- 1 | { 2 | version: '1.0', 3 | defaultSchema: 'mongo', 4 | schemas: [ 5 | { 6 | type: 'custom', 7 | name: 'mongo_raw', 8 | factory: 'net.hydromatic.optiq.impl.mongodb.MongoSchemaFactory', 9 | operand: { 10 | host: 'localhost', 11 | database: 'test' 12 | } 13 | }, 14 | { 15 | name: 'mongo', 16 | tables: [ 17 | { 18 | name: 'ZIPS', 19 | type: 'view', 20 | sql: 'select cast(_MAP[\'city\'] AS varchar(20)) AS city,\n cast(_MAP[\'loc\'][0] AS float) AS longitude, cast(_MAP[\'loc\'][1] AS float) AS latitude, cast(_MAP[\'pop\'] AS integer) AS pop, cast(_MAP[\'state\'] AS varchar(2)) AS state, cast(_MAP[\'_id\'] AS varchar(5)) AS id from \"mongo_raw\".\"zips\"' 21 | } 22 | ] 23 | } 24 | ] 25 | } 26 | -------------------------------------------------------------------------------- /plus/src/main/java/net/hydromatic/optiq/impl/tpcds/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | 19 | /** 20 | * TPC-DS schema. 21 | */ 22 | package net.hydromatic.optiq.impl.tpcds; 23 | 24 | // End package-info.java 25 | -------------------------------------------------------------------------------- /plus/src/main/java/net/hydromatic/optiq/impl/tpch/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | 19 | /** 20 | * TPC-H schema. 21 | */ 22 | package net.hydromatic.optiq.impl.tpch; 23 | 24 | // End package-info.java 25 | -------------------------------------------------------------------------------- /plus/src/test/java/net/hydromatic/optiq/test/PlusSuite.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | package net.hydromatic.optiq.test; 19 | 20 | import net.hydromatic.optiq.impl.tpcds.TpcdsTest; 21 | import net.hydromatic.optiq.impl.tpch.TpchTest; 22 | 23 | import org.junit.runner.RunWith; 24 | import org.junit.runners.Suite; 25 | 26 | /** 27 | * Suite consisting of all tests in the optiq-plus module. 28 | */ 29 | @RunWith(Suite.class) 30 | @Suite.SuiteClasses({ 31 | TpcdsTest.class, 32 | TpchTest.class 33 | }) 34 | public class PlusSuite { 35 | } 36 | 37 | // End PlusSuite.java 38 | -------------------------------------------------------------------------------- /spark/src/main/java/net/hydromatic/optiq/impl/spark/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | 19 | /** 20 | * Adapter based on the Apache Spark data management system. 21 | */ 22 | package net.hydromatic.optiq.impl.spark; 23 | 24 | // End package-info.java 25 | -------------------------------------------------------------------------------- /spark/src/test/java/net/hydromatic/optiq/test/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | 19 | /** 20 | * Unit tests for Optiq. 21 | */ 22 | package net.hydromatic.optiq.test; 23 | 24 | // End package-info.java 25 | -------------------------------------------------------------------------------- /splunk/src/main/java/net/hydromatic/optiq/impl/splunk/SplunkDriverVersion.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | package net.hydromatic.optiq.impl.splunk; 19 | 20 | import net.hydromatic.avatica.DriverVersion; 21 | 22 | /** 23 | * Version information for Optiq JDBC Driver for Splunk. 24 | */ 25 | class SplunkDriverVersion extends DriverVersion { 26 | /** Creates an OptiqDriverVersion. */ 27 | SplunkDriverVersion() { 28 | super( 29 | "Optiq JDBC Driver for Splunk", 30 | "0.2", 31 | "Optiq-Splunk", 32 | "0.2", 33 | true, 34 | 0, 35 | 1, 36 | 0, 37 | 1); 38 | } 39 | } 40 | 41 | // End SplunkDriverVersion.java 42 | -------------------------------------------------------------------------------- /splunk/src/main/java/net/hydromatic/optiq/impl/splunk/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | 19 | /** 20 | * Splunk query provider. 21 | * 22 | *

There is a single table, called "Splunk". It has fixed columns 23 | * "host", "index", "source", "sourcetype". It has a variable type, so other 24 | * fields are held in a map field called "_others".

25 | */ 26 | package net.hydromatic.optiq.impl.splunk; 27 | 28 | // End package-info.java 29 | -------------------------------------------------------------------------------- /splunk/src/main/java/net/hydromatic/optiq/impl/splunk/search/SearchResultListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | package net.hydromatic.optiq.impl.splunk.search; 19 | 20 | /** 21 | * Called each time a search returns a record. 22 | */ 23 | public interface SearchResultListener { 24 | /** 25 | * Handles a record from a search result. 26 | * 27 | * @param fieldValues Values of the record 28 | * @return true to continue parsing, false otherwise 29 | */ 30 | boolean processSearchResult(String[] fieldValues); 31 | 32 | void setFieldNames(String[] fieldNames); 33 | } 34 | 35 | // End SearchResultListener.java 36 | -------------------------------------------------------------------------------- /splunk/src/main/java/net/hydromatic/optiq/impl/splunk/search/SplunkConnection.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | package net.hydromatic.optiq.impl.splunk.search; 19 | 20 | import net.hydromatic.linq4j.Enumerator; 21 | 22 | import java.util.List; 23 | import java.util.Map; 24 | 25 | /** 26 | * Connection to Splunk. 27 | */ 28 | public interface SplunkConnection { 29 | void getSearchResults(String search, Map otherArgs, 30 | List fieldList, SearchResultListener srl); 31 | 32 | Enumerator getSearchResultEnumerator(String search, 33 | Map otherArgs, List fieldList); 34 | } 35 | 36 | // End SplunkConnection.java 37 | -------------------------------------------------------------------------------- /splunk/src/main/java/net/hydromatic/optiq/impl/splunk/search/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | 19 | /** 20 | * Provides utility classes. 21 | */ 22 | package org.eigenbase.util; 23 | 24 | // End package-info.java 25 | -------------------------------------------------------------------------------- /splunk/src/main/java/net/hydromatic/optiq/impl/splunk/util/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | 19 | /** 20 | * Provides utility classes. 21 | */ 22 | package org.eigenbase.util; 23 | 24 | // End package-info.java 25 | -------------------------------------------------------------------------------- /splunk/src/test/java/net/hydromatic/optiq/test/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | 19 | /** 20 | * Provides utility classes. 21 | */ 22 | package org.eigenbase.util; 23 | 24 | // End package-info.java 25 | -------------------------------------------------------------------------------- /sqlline.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | :: sqlline.bat - Windows script to launch SQL shell 3 | :: 4 | :: Licensed to Julian Hyde under one or more contributor license 5 | :: agreements. See the NOTICE file distributed with this work for 6 | :: additional information regarding copyright ownership. 7 | :: 8 | :: Julian Hyde licenses this file to you under the Apache License, 9 | :: Version 2.0 (the "License"); you may not use this file except in 10 | :: compliance with the License. You may obtain a copy of the License at: 11 | :: 12 | :: http://www.apache.org/licenses/LICENSE-2.0 13 | :: 14 | :: Unless required by applicable law or agreed to in writing, software 15 | :: distributed under the License is distributed on an "AS IS" BASIS, 16 | :: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | :: See the License for the specific language governing permissions and 18 | :: limitations under the License. 19 | :: 20 | :: Example: 21 | :: > sqlline.bat 22 | :: sqlline> !connect jdbc:optiq: admin admin 23 | 24 | :: Copy dependency jars on first call. (To force jar refresh, remove target\dependencies) 25 | if not exist target\dependencies (call mvn -B dependency:copy-dependencies -DoverWriteReleases=false -DoverWriteSnapshots=false -DoverWriteIfNewer=true -DoutputDirectory=target\dependencies) 26 | 27 | java -Xmx1G -cp ".\target\dependencies\*;core\target\dependencies\*;avatica\target\dependencies\*;mongodb\target\dependencies\*;spark\target\dependencies\*;splunk\target\dependencies\*" sqlline.SqlLine --verbose=true %* 28 | 29 | :: End sqlline.bat 30 | -------------------------------------------------------------------------------- /src/main/config/checkstyle/header.txt: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | -------------------------------------------------------------------------------- /ubenchmark/src/main/java/net/hydromatic/optiq/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | // Licensed to Julian Hyde under one or more contributor license 3 | // agreements. See the NOTICE file distributed with this work for 4 | // additional information regarding copyright ownership. 5 | // 6 | // Julian Hyde licenses this file to you under the Apache License, 7 | // Version 2.0 (the "License"); you may not use this file except in 8 | // compliance with the License. You may obtain a copy of the License at: 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | */ 18 | /** 19 | * Microbenchmarks to test optiq performance. 20 | * The way to run is 21 | * {@code mvn package && java -jar ./target/ubenchmarks.jar -wi 5 -i 5 -f 1}. 22 | *

23 | * To run with profiling, use {@code java -Djmh.stack.lines=10 -jar 24 | * ./target/ubenchmarks.jar -prof hs_comp,hs_gc,stack -f 1 -wi 5}. 25 | */ 26 | package net.hydromatic.optiq; 27 | --------------------------------------------------------------------------------