├── .gitignore ├── LICENSE ├── README.md ├── build.bat ├── hansql-common ├── pom.xml └── src │ └── main │ └── java │ ├── io │ └── netty │ │ └── buffer │ │ ├── DrillBuf.java │ │ ├── ExpandableByteBuf.java │ │ ├── LargeBuffer.java │ │ ├── MutableWrappedByteBuf.java │ │ ├── PooledByteBufAllocatorL.java │ │ └── UnsafeDirectLittleEndian.java │ └── org │ └── lealone │ └── hansql │ ├── common │ ├── AutoCloseablePointer.java │ ├── AutoCloseables.java │ ├── CatastrophicFailure.java │ ├── DeferredException.java │ ├── DrillAutoCloseables.java │ ├── EventProcessor.java │ ├── HistoricalLog.java │ ├── KerberosUtil.java │ ├── SelfCleaningRunnable.java │ ├── StackTrace.java │ ├── Version.java │ ├── collections │ │ ├── Collectors.java │ │ ├── ImmutableEntry.java │ │ └── MapWithOrdinal.java │ ├── concurrent │ │ ├── AutoCloseableLock.java │ │ └── ExtendedLatch.java │ ├── config │ │ ├── ConfigConstants.java │ │ ├── ConfigFileInfo.java │ │ ├── ConfigProvider.java │ │ ├── DrillConfig.java │ │ ├── DrillExecConfigFileInfo.java │ │ ├── DrillProperties.java │ │ ├── DrillRMConfigFileInfo.java │ │ ├── NestedConfig.java │ │ └── package-info.java │ ├── exceptions │ │ ├── DrillConfigurationException.java │ │ ├── DrillException.java │ │ ├── DrillRuntimeException.java │ │ ├── ErrorHelper.java │ │ ├── RetryAfterSpillException.java │ │ ├── UserException.java │ │ ├── UserExceptionContext.java │ │ ├── UserExceptionUtils.java │ │ └── package-info.java │ ├── map │ │ └── CaseInsensitiveMap.java │ ├── package-info.java │ ├── scanner │ │ ├── BuildTimeScan.java │ │ ├── ClassPathScanner.java │ │ ├── RunTimeScan.java │ │ └── persistence │ │ │ ├── AnnotatedClassDescriptor.java │ │ │ ├── AnnotationDescriptor.java │ │ │ ├── AttributeDescriptor.java │ │ │ ├── ChildClassDescriptor.java │ │ │ ├── FieldDescriptor.java │ │ │ ├── ParentClassDescriptor.java │ │ │ ├── ScanResult.java │ │ │ └── TypeDescriptor.java │ ├── types │ │ ├── BooleanType.java │ │ ├── DataMode.java │ │ ├── MajorType.java │ │ ├── MinorType.java │ │ ├── SchemaTypeProtos.java │ │ ├── TypeProtos.java │ │ ├── Types.java │ │ └── package-info.java │ └── util │ │ ├── ConstructorChecker.java │ │ ├── DataInputInputStream.java │ │ ├── DataOutputOutputStream.java │ │ ├── DrillExceptionUtil.java │ │ ├── DrillFileUtils.java │ │ ├── DrillStringUtils.java │ │ ├── DrillVersionInfo.java │ │ ├── GuavaUtils.java │ │ ├── function │ │ ├── CheckedConsumer.java │ │ ├── CheckedFunction.java │ │ └── CheckedSupplier.java │ │ └── package-info.java │ └── exec │ ├── exception │ └── OutOfMemoryException.java │ ├── memory │ ├── Accountant.java │ ├── AllocationManager.java │ ├── AllocationReservation.java │ ├── AllocatorClosedException.java │ ├── BaseAllocator.java │ ├── BoundsChecking.java │ ├── BufferAllocator.java │ ├── ChildAllocator.java │ ├── DrillByteBufAllocator.java │ ├── README.md │ ├── RootAllocator.java │ ├── RootAllocatorFactory.java │ └── package-info.java │ ├── metrics │ ├── CpuGaugeSet.java │ └── DrillMetrics.java │ ├── ops │ └── BufferManager.java │ ├── proto │ ├── BitControl.java │ ├── BitData.java │ ├── CoordinationProtos.java │ ├── ExecProtos.java │ ├── SchemaCoordinationProtos.java │ ├── SchemaDefProtos.java │ ├── SchemaExecProtos.java │ ├── SchemaUserBitShared.java │ ├── UserBitShared.java │ └── UserProtos.java │ └── util │ ├── AssertionUtil.java │ └── SystemPropertyUtil.java ├── hansql-dist ├── assembly.xml ├── bin │ ├── lealone.bat │ ├── lealone.sh │ ├── sqlshell.bat │ └── sqlshell.sh ├── conf │ ├── lealone.yaml │ ├── log4j2.xml │ └── logback.xml └── pom.xml ├── hansql-engine ├── pom.xml └── src │ └── main │ ├── java │ └── org │ │ └── lealone │ │ └── hansql │ │ └── engine │ │ ├── HanEngine.java │ │ ├── index │ │ ├── LealoneIndexCollection.java │ │ ├── LealoneIndexDescriptor.java │ │ ├── LealoneIndexDiscover.java │ │ ├── LealoneIndexGroupScan.java │ │ ├── LealoneIndexSubScan.java │ │ ├── LealoneIndexTable.java │ │ ├── LealonePushFilterIntoScan.java │ │ ├── LealonePushLimitIntoScan.java │ │ └── LealonePushProjectIntoScan.java │ │ ├── operator │ │ ├── OlapOperator.java │ │ └── OlapOperatorFactory.java │ │ ├── server │ │ ├── HanBatchResult.java │ │ ├── HanClientConnection.java │ │ ├── HanResult.java │ │ ├── HanSQLServer.java │ │ └── HanSQLServerEngine.java │ │ ├── sql │ │ ├── HanSQLEngine.java │ │ ├── HanSQLParser.java │ │ └── HanSQLQuery.java │ │ └── storage │ │ ├── LealoneGroupScan.java │ │ ├── LealoneRecordReader.java │ │ ├── LealoneScanBatchCreator.java │ │ ├── LealoneScanSpec.java │ │ ├── LealoneSchema.java │ │ ├── LealoneSchemaFactory.java │ │ ├── LealoneStoragePlugin.java │ │ ├── LealoneStoragePluginConfig.java │ │ ├── LealoneSubScan.java │ │ └── LealoneTable.java │ └── resources │ ├── META-INF │ └── services │ │ ├── org.lealone.server.ProtocolServerEngine │ │ ├── org.lealone.sql.SQLEngine │ │ └── org.lealone.sql.operator.OperatorFactory │ └── drill-module.conf ├── hansql-executor ├── pom.xml └── src │ └── main │ ├── antlr4 │ └── org │ │ └── lealone │ │ └── hansql │ │ └── exec │ │ └── record │ │ └── metadata │ │ └── schema │ │ └── parser │ │ ├── SchemaLexer.g4 │ │ └── SchemaParser.g4 │ ├── codegen │ ├── config.fmpp │ ├── data │ │ ├── Parser.tdd │ │ └── ValueVectorTypes.tdd │ ├── includes │ │ ├── compoundIdentifier.ftl │ │ ├── license.ftl │ │ ├── parserImpls.ftl │ │ └── vv_imports.ftl │ └── templates │ │ ├── AbstractRecordWriter.java │ │ ├── DrillVersionInfo.java │ │ ├── EventBasedRecordWriter.java │ │ ├── JsonBaseStatisticsRecordWriter.java │ │ ├── JsonOutputRecordWriter.java │ │ ├── ParquetOutputRecordWriter.java │ │ ├── ParquetTypeHelper.java │ │ ├── RecordValueAccessor.java │ │ ├── RecordWriter.java │ │ ├── SqlAccessors.java │ │ ├── StatisticsRecordWriter.java │ │ ├── StatisticsRecordWriterImpl.java │ │ ├── StringOutputRecordWriter.java │ │ └── TypeHelper.java │ ├── java │ └── org │ │ ├── apache │ │ └── parquet │ │ │ └── hadoop │ │ │ ├── ColumnChunkIncReadStore.java │ │ │ └── ParquetColumnChunkPageWriteStore.java │ │ └── lealone │ │ └── hansql │ │ ├── exec │ │ ├── ExecConstants.java │ │ ├── FragmentExecutor.java │ │ ├── SqlExecutor.java │ │ ├── cache │ │ │ ├── AbstractStreamSerializable.java │ │ │ ├── CachedVectorContainer.java │ │ │ ├── Counter.java │ │ │ ├── DistributedCache.java │ │ │ ├── DistributedMap.java │ │ │ ├── DistributedMultiMap.java │ │ │ ├── DrillSerializable.java │ │ │ ├── LoopedAbstractDrillSerializable.java │ │ │ ├── SerializationDefinition.java │ │ │ ├── VectorAccessibleSerializable.java │ │ │ ├── VectorSerializer.java │ │ │ └── package-info.java │ │ ├── compile │ │ │ ├── AbstractClassCompiler.java │ │ │ ├── AsmUtil.java │ │ │ ├── ByteCodeLoader.java │ │ │ ├── CachedClassLoader.java │ │ │ ├── CheckClassVisitorFsm.java │ │ │ ├── CheckMethodVisitorFsm.java │ │ │ ├── ClassBodyBuilder.java │ │ │ ├── ClassBuilder.java │ │ │ ├── ClassCompilerSelector.java │ │ │ ├── ClassTransformer.java │ │ │ ├── CodeCompiler.java │ │ │ ├── CompilationConfig.java │ │ │ ├── DrillCheckClassAdapter.java │ │ │ ├── DrillDiagnosticListener.java │ │ │ ├── DrillInitMethodVisitor.java │ │ │ ├── DrillJavaFileManager.java │ │ │ ├── DrillJavaFileObject.java │ │ │ ├── FsmCursor.java │ │ │ ├── FsmDescriptor.java │ │ │ ├── InnerClassAccessStripper.java │ │ │ ├── JDKClassCompiler.java │ │ │ ├── JaninoClassCompiler.java │ │ │ ├── LogWriter.java │ │ │ ├── MergeAdapter.java │ │ │ ├── QueryClassLoader.java │ │ │ ├── RetargetableClassVisitor.java │ │ │ ├── TemplateClassDefinition.java │ │ │ ├── bytecode │ │ │ │ ├── DirectSorter.java │ │ │ │ ├── InstructionModifier.java │ │ │ │ ├── MethodAnalyzer.java │ │ │ │ ├── ReplacingBasicValue.java │ │ │ │ ├── ReplacingInterpreter.java │ │ │ │ ├── ScalarReplacementNode.java │ │ │ │ ├── ScalarReplacementTypes.java │ │ │ │ ├── TrackingInstructionList.java │ │ │ │ ├── ValueHolderIden.java │ │ │ │ ├── ValueHolderReplacementVisitor.java │ │ │ │ └── package-info.java │ │ │ ├── package-info.java │ │ │ └── sig │ │ │ │ ├── CodeGeneratorArgument.java │ │ │ │ ├── CodeGeneratorMethod.java │ │ │ │ ├── CodeGeneratorSignature.java │ │ │ │ ├── ConstantExpressionIdentifier.java │ │ │ │ ├── GeneratorMapping.java │ │ │ │ ├── MappingSet.java │ │ │ │ ├── RuntimeOverridden.java │ │ │ │ ├── Signature.java │ │ │ │ ├── SignatureHolder.java │ │ │ │ ├── VVReadBatch.java │ │ │ │ ├── VVWriteBatch.java │ │ │ │ └── package-info.java │ │ ├── context │ │ │ ├── BootStrapContext.java │ │ │ ├── DrillbitContext.java │ │ │ ├── FailureUtils.java │ │ │ ├── NamedThreadFactory.java │ │ │ ├── QueryProfileStoreContext.java │ │ │ └── options │ │ │ │ ├── BaseOptionManager.java │ │ │ │ ├── DrillConfigIterator.java │ │ │ │ ├── FallbackOptionManager.java │ │ │ │ ├── FragmentOptionManager.java │ │ │ │ ├── InMemoryOptionManager.java │ │ │ │ ├── OptionDefinition.java │ │ │ │ ├── OptionList.java │ │ │ │ ├── OptionManager.java │ │ │ │ ├── OptionMetaData.java │ │ │ │ ├── OptionSet.java │ │ │ │ ├── OptionValidator.java │ │ │ │ ├── OptionValue.java │ │ │ │ ├── PersistedOptionValue.java │ │ │ │ ├── QueryOptionManager.java │ │ │ │ ├── SessionOptionManager.java │ │ │ │ ├── SystemOptionManager.java │ │ │ │ └── TypeValidators.java │ │ ├── coord │ │ │ ├── ClusterCoordinator.java │ │ │ ├── DrillbitEndpointSerDe.java │ │ │ ├── local │ │ │ │ ├── LocalClusterCoordinator.java │ │ │ │ └── MapBackedStore.java │ │ │ └── store │ │ │ │ ├── BaseTransientStore.java │ │ │ │ ├── CachingTransientStoreFactory.java │ │ │ │ ├── TransientStore.java │ │ │ │ ├── TransientStoreConfig.java │ │ │ │ ├── TransientStoreConfigBuilder.java │ │ │ │ ├── TransientStoreEvent.java │ │ │ │ ├── TransientStoreEventType.java │ │ │ │ ├── TransientStoreFactory.java │ │ │ │ └── TransientStoreListener.java │ │ ├── dotdrill │ │ │ ├── DotDrillFile.java │ │ │ ├── DotDrillType.java │ │ │ ├── DotDrillUtil.java │ │ │ ├── View.java │ │ │ └── package-info.java │ │ ├── exception │ │ │ ├── ClassTransformationException.java │ │ │ ├── DrillbitStartupException.java │ │ │ ├── FragmentSetupException.java │ │ │ ├── FunctionValidationException.java │ │ │ ├── JarValidationException.java │ │ │ ├── OptimizerException.java │ │ │ ├── SchemaChangeException.java │ │ │ ├── SetupException.java │ │ │ ├── StoreException.java │ │ │ ├── UnsupportedOperatorCollector.java │ │ │ ├── VersionMismatchException.java │ │ │ └── package-info.java │ │ ├── expr │ │ │ ├── AbstractExecExprVisitor.java │ │ │ ├── BatchReference.java │ │ │ ├── BooleanPredicate.java │ │ │ ├── ClassGenerator.java │ │ │ ├── CloneVisitor.java │ │ │ ├── CodeGenerator.java │ │ │ ├── ComparisonPredicate.java │ │ │ ├── DebugStringBuilder.java │ │ │ ├── DirectExpression.java │ │ │ ├── DrillAggFunc.java │ │ │ ├── DrillFunc.java │ │ │ ├── DrillFuncHolderExpr.java │ │ │ ├── DrillSimpleFunc.java │ │ │ ├── EqualityVisitor.java │ │ │ ├── EvaluationVisitor.java │ │ │ ├── ExactStatisticsConstants.java │ │ │ ├── ExpressionTreeMaterializer.java │ │ │ ├── FilterBuilder.java │ │ │ ├── FilterPredicate.java │ │ │ ├── GetSetVectorHelper.java │ │ │ ├── HashVisitor.java │ │ │ ├── HoldingContainerExpression.java │ │ │ ├── IsPredicate.java │ │ │ ├── SingleClassStringWriter.java │ │ │ ├── SizedJBlock.java │ │ │ ├── StatisticsProvider.java │ │ │ ├── ValueVectorReadExpression.java │ │ │ ├── ValueVectorWriteExpression.java │ │ │ ├── annotations │ │ │ │ ├── FunctionTemplate.java │ │ │ │ ├── Output.java │ │ │ │ ├── Param.java │ │ │ │ └── Workspace.java │ │ │ ├── fn │ │ │ │ ├── AbstractFuncHolder.java │ │ │ │ ├── DrillAggFuncHolder.java │ │ │ │ ├── DrillComplexWriterAggFuncHolder.java │ │ │ │ ├── DrillComplexWriterFuncHolder.java │ │ │ │ ├── DrillFuncHolder.java │ │ │ │ ├── DrillSimpleFuncHolder.java │ │ │ │ ├── FunctionAttributes.java │ │ │ │ ├── FunctionConverter.java │ │ │ │ ├── FunctionGenerationHelper.java │ │ │ │ ├── FunctionImplementationRegistry.java │ │ │ │ ├── FunctionInitializer.java │ │ │ │ ├── FunctionLookupContext.java │ │ │ │ ├── FunctionUtils.java │ │ │ │ ├── ImportGrabber.java │ │ │ │ ├── MethodGrabbingVisitor.java │ │ │ │ ├── PluggableFunctionRegistry.java │ │ │ │ ├── ValueReference.java │ │ │ │ ├── WorkspaceReference.java │ │ │ │ ├── impl │ │ │ │ │ ├── AbstractSqlPatternMatcher.java │ │ │ │ │ ├── CharSequenceWrapper.java │ │ │ │ │ ├── DrillByteArray.java │ │ │ │ │ ├── DrillHash.java │ │ │ │ │ ├── HashHelper.java │ │ │ │ │ ├── MappifyUtility.java │ │ │ │ │ ├── MurmurHash3.java │ │ │ │ │ ├── RegexpUtil.java │ │ │ │ │ ├── SqlPatternComplexMatcher.java │ │ │ │ │ ├── SqlPatternConstantMatcher.java │ │ │ │ │ ├── SqlPatternContainsMatcher.java │ │ │ │ │ ├── SqlPatternEndsWithMatcher.java │ │ │ │ │ ├── SqlPatternFactory.java │ │ │ │ │ ├── SqlPatternMatcher.java │ │ │ │ │ ├── SqlPatternStartsWithMatcher.java │ │ │ │ │ ├── StringFunctionHelpers.java │ │ │ │ │ ├── StringFunctionUtil.java │ │ │ │ │ ├── ValueVectorHashHelper.java │ │ │ │ │ ├── VarHelpers.java │ │ │ │ │ └── XXHash.java │ │ │ │ ├── interpreter │ │ │ │ │ └── InterpreterEvaluator.java │ │ │ │ ├── output │ │ │ │ │ ├── ConcatReturnTypeInference.java │ │ │ │ │ ├── DecimalReturnTypeInference.java │ │ │ │ │ ├── DefaultReturnTypeInference.java │ │ │ │ │ ├── OutputWidthCalculator.java │ │ │ │ │ ├── OutputWidthCalculators.java │ │ │ │ │ ├── PadReturnTypeInference.java │ │ │ │ │ ├── ReturnTypeInference.java │ │ │ │ │ ├── SameInOutLengthReturnTypeInference.java │ │ │ │ │ └── StringCastReturnTypeInference.java │ │ │ │ └── registry │ │ │ │ │ ├── FunctionHolder.java │ │ │ │ │ ├── FunctionRegistryHolder.java │ │ │ │ │ ├── JarScan.java │ │ │ │ │ ├── LocalFunctionRegistry.java │ │ │ │ │ └── RemoteFunctionRegistry.java │ │ │ ├── package-info.java │ │ │ └── stat │ │ │ │ └── RowsMatch.java │ │ ├── ops │ │ │ ├── AccountingUserConnection.java │ │ │ ├── BaseFragmentContext.java │ │ │ ├── BaseOperatorContext.java │ │ │ ├── BufferManagerImpl.java │ │ │ ├── Consumer.java │ │ │ ├── ContextInformation.java │ │ │ ├── ExchangeFragmentContext.java │ │ │ ├── ExecutorFragmentContext.java │ │ │ ├── FragmentContext.java │ │ │ ├── FragmentContextImpl.java │ │ │ ├── FragmentContextInterface.java │ │ │ ├── FragmentStats.java │ │ │ ├── MetricDef.java │ │ │ ├── OpProfileDef.java │ │ │ ├── OperatorContext.java │ │ │ ├── OperatorContextImpl.java │ │ │ ├── OperatorMetricRegistry.java │ │ │ ├── OperatorStatReceiver.java │ │ │ ├── OperatorStats.java │ │ │ ├── OperatorUtilities.java │ │ │ ├── OptimizerRulesContext.java │ │ │ ├── QueryContext.java │ │ │ ├── RootFragmentContext.java │ │ │ ├── SendingAccountor.java │ │ │ ├── UdfUtilities.java │ │ │ └── ViewExpansionContext.java │ │ ├── opt │ │ │ ├── BasicOptimizer.java │ │ │ ├── IdentityOptimizer.java │ │ │ └── Optimizer.java │ │ ├── physical │ │ │ ├── EndpointAffinity.java │ │ │ ├── MinorFragmentEndpoint.java │ │ │ ├── PhysicalOperatorSetupException.java │ │ │ ├── PhysicalPlan.java │ │ │ ├── base │ │ │ │ ├── AbstractBase.java │ │ │ │ ├── AbstractDbGroupScan.java │ │ │ │ ├── AbstractDbSubScan.java │ │ │ │ ├── AbstractExchange.java │ │ │ │ ├── AbstractFileGroupScan.java │ │ │ │ ├── AbstractGroupScan.java │ │ │ │ ├── AbstractGroupScanWithMetadata.java │ │ │ │ ├── AbstractJoinPop.java │ │ │ │ ├── AbstractMultiple.java │ │ │ │ ├── AbstractPhysicalVisitor.java │ │ │ │ ├── AbstractReceiver.java │ │ │ │ ├── AbstractSender.java │ │ │ │ ├── AbstractSingle.java │ │ │ │ ├── AbstractStore.java │ │ │ │ ├── AbstractSubScan.java │ │ │ │ ├── AbstractWriter.java │ │ │ │ ├── DbGroupScan.java │ │ │ │ ├── DbSubScan.java │ │ │ │ ├── Exchange.java │ │ │ │ ├── FileGroupScan.java │ │ │ │ ├── FileSystemMetadataProviderManager.java │ │ │ │ ├── FragmentLeaf.java │ │ │ │ ├── FragmentRoot.java │ │ │ │ ├── GroupScan.java │ │ │ │ ├── HasAffinity.java │ │ │ │ ├── IndexGroupScan.java │ │ │ │ ├── LateralContract.java │ │ │ │ ├── Leaf.java │ │ │ │ ├── MetadataProviderManager.java │ │ │ │ ├── ParquetMetadataProvider.java │ │ │ │ ├── ParquetTableMetadataProvider.java │ │ │ │ ├── PhysicalOperator.java │ │ │ │ ├── PhysicalOperatorUtil.java │ │ │ │ ├── PhysicalVisitor.java │ │ │ │ ├── Receiver.java │ │ │ │ ├── Root.java │ │ │ │ ├── Scan.java │ │ │ │ ├── ScanStats.java │ │ │ │ ├── SchemalessBatchCreator.java │ │ │ │ ├── SchemalessScan.java │ │ │ │ ├── Sender.java │ │ │ │ ├── SimpleFileTableMetadataProvider.java │ │ │ │ ├── Store.java │ │ │ │ ├── SubScan.java │ │ │ │ ├── TableMetadataProvider.java │ │ │ │ ├── TableMetadataProviderBuilder.java │ │ │ │ └── Writer.java │ │ │ ├── config │ │ │ │ ├── AbstractDeMuxExchange.java │ │ │ │ ├── AbstractMuxExchange.java │ │ │ │ ├── BroadcastExchange.java │ │ │ │ ├── BroadcastSender.java │ │ │ │ ├── ComplexToJson.java │ │ │ │ ├── ExternalSort.java │ │ │ │ ├── Filter.java │ │ │ │ ├── FlattenPOP.java │ │ │ │ ├── HashAggregate.java │ │ │ │ ├── HashJoinPOP.java │ │ │ │ ├── HashPartitionSender.java │ │ │ │ ├── HashToMergeExchange.java │ │ │ │ ├── HashToRandomExchange.java │ │ │ │ ├── IteratorValidator.java │ │ │ │ ├── LateralJoinPOP.java │ │ │ │ ├── Limit.java │ │ │ │ ├── MergeJoinPOP.java │ │ │ │ ├── MergingReceiverPOP.java │ │ │ │ ├── NestedLoopJoinPOP.java │ │ │ │ ├── OrderedMuxExchange.java │ │ │ │ ├── OrderedPartitionExchange.java │ │ │ │ ├── OrderedPartitionSender.java │ │ │ │ ├── PartitionLimit.java │ │ │ │ ├── PartitionRange.java │ │ │ │ ├── ProducerConsumer.java │ │ │ │ ├── Project.java │ │ │ │ ├── RangePartitionExchange.java │ │ │ │ ├── RangePartitionSender.java │ │ │ │ ├── RowKeyJoinPOP.java │ │ │ │ ├── RuntimeFilterPOP.java │ │ │ │ ├── Screen.java │ │ │ │ ├── SelectionVectorRemover.java │ │ │ │ ├── SingleMergeExchange.java │ │ │ │ ├── SingleSender.java │ │ │ │ ├── Sort.java │ │ │ │ ├── StatisticsAggregate.java │ │ │ │ ├── StatisticsMerge.java │ │ │ │ ├── StreamingAggregate.java │ │ │ │ ├── TopN.java │ │ │ │ ├── Trace.java │ │ │ │ ├── UnionAll.java │ │ │ │ ├── UnionExchange.java │ │ │ │ ├── UnnestPOP.java │ │ │ │ ├── UnorderedDeMuxExchange.java │ │ │ │ ├── UnorderedMuxExchange.java │ │ │ │ ├── UnorderedReceiver.java │ │ │ │ ├── UnpivotMaps.java │ │ │ │ ├── Values.java │ │ │ │ └── WindowPOP.java │ │ │ ├── impl │ │ │ │ ├── BaseRootExec.java │ │ │ │ ├── BatchCreator.java │ │ │ │ ├── ImplCreator.java │ │ │ │ ├── MergingReceiverCreator.java │ │ │ │ ├── OperatorCreatorRegistry.java │ │ │ │ ├── OutputMutator.java │ │ │ │ ├── PhysicalConfig.java │ │ │ │ ├── RootCreator.java │ │ │ │ ├── RootExec.java │ │ │ │ ├── ScanBatch.java │ │ │ │ ├── ScreenCreator.java │ │ │ │ ├── SingleSenderCreator.java │ │ │ │ ├── StatisticsWriterRecordBatch.java │ │ │ │ ├── TopN │ │ │ │ │ ├── PriorityQueue.java │ │ │ │ │ ├── PriorityQueueTemplate.java │ │ │ │ │ ├── TopNBatch.java │ │ │ │ │ └── TopNSortBatchCreator.java │ │ │ │ ├── TraceInjector.java │ │ │ │ ├── WriterRecordBatch.java │ │ │ │ ├── aggregate │ │ │ │ │ ├── BatchIterator.java │ │ │ │ │ ├── HashAggBatch.java │ │ │ │ │ ├── HashAggBatchCreator.java │ │ │ │ │ ├── HashAggSpilledPartition.java │ │ │ │ │ ├── HashAggTemplate.java │ │ │ │ │ ├── HashAggUpdater.java │ │ │ │ │ ├── HashAggregator.java │ │ │ │ │ ├── InternalBatch.java │ │ │ │ │ ├── SpilledRecordbatch.java │ │ │ │ │ ├── StreamingAggBatch.java │ │ │ │ │ ├── StreamingAggBatchCreator.java │ │ │ │ │ ├── StreamingAggTemplate.java │ │ │ │ │ └── StreamingAggregator.java │ │ │ │ ├── broadcastsender │ │ │ │ │ ├── BroadcastSenderCreator.java │ │ │ │ │ └── BroadcastSenderRootExec.java │ │ │ │ ├── common │ │ │ │ │ ├── AbstractSpilledPartitionMetadata.java │ │ │ │ │ ├── ChainedHashTable.java │ │ │ │ │ ├── CodeGenMemberInjector.java │ │ │ │ │ ├── Comparator.java │ │ │ │ │ ├── HashPartition.java │ │ │ │ │ ├── HashTable.java │ │ │ │ │ ├── HashTableAllocationTracker.java │ │ │ │ │ ├── HashTableConfig.java │ │ │ │ │ ├── HashTableStats.java │ │ │ │ │ ├── HashTableTemplate.java │ │ │ │ │ ├── IndexPointer.java │ │ │ │ │ ├── SpilledPartitionMetadata.java │ │ │ │ │ └── SpilledState.java │ │ │ │ ├── filter │ │ │ │ │ ├── EvalSetupException.java │ │ │ │ │ ├── EvaluationPredicate.java │ │ │ │ │ ├── FilterBatchCreator.java │ │ │ │ │ ├── FilterRecordBatch.java │ │ │ │ │ ├── FilterSignature.java │ │ │ │ │ ├── FilterTemplate2.java │ │ │ │ │ ├── FilterTemplate4.java │ │ │ │ │ ├── Filterer.java │ │ │ │ │ ├── ReturnValueExpression.java │ │ │ │ │ ├── RuntimeFilterBatchCreator.java │ │ │ │ │ └── RuntimeFilterRecordBatch.java │ │ │ │ ├── flatten │ │ │ │ │ ├── FlattenBatchCreator.java │ │ │ │ │ ├── FlattenRecordBatch.java │ │ │ │ │ ├── FlattenTemplate.java │ │ │ │ │ └── Flattener.java │ │ │ │ ├── join │ │ │ │ │ ├── BatchSizePredictor.java │ │ │ │ │ ├── BatchSizePredictorImpl.java │ │ │ │ │ ├── HashJoinBatch.java │ │ │ │ │ ├── HashJoinBatchCreator.java │ │ │ │ │ ├── HashJoinHelper.java │ │ │ │ │ ├── HashJoinHelperSizeCalculator.java │ │ │ │ │ ├── HashJoinHelperSizeCalculatorImpl.java │ │ │ │ │ ├── HashJoinHelperUnusedSizeImpl.java │ │ │ │ │ ├── HashJoinMechanicalMemoryCalculator.java │ │ │ │ │ ├── HashJoinMemoryCalculator.java │ │ │ │ │ ├── HashJoinMemoryCalculatorImpl.java │ │ │ │ │ ├── HashJoinProbe.java │ │ │ │ │ ├── HashJoinProbeTemplate.java │ │ │ │ │ ├── HashJoinState.java │ │ │ │ │ ├── HashJoinStateCalculator.java │ │ │ │ │ ├── HashTableSizeCalculator.java │ │ │ │ │ ├── HashTableSizeCalculatorConservativeImpl.java │ │ │ │ │ ├── HashTableSizeCalculatorLeanImpl.java │ │ │ │ │ ├── JoinStatus.java │ │ │ │ │ ├── JoinTemplate.java │ │ │ │ │ ├── JoinUtils.java │ │ │ │ │ ├── JoinWorker.java │ │ │ │ │ ├── LateralJoinBatch.java │ │ │ │ │ ├── LateralJoinBatchCreator.java │ │ │ │ │ ├── MergeJoinBatch.java │ │ │ │ │ ├── MergeJoinCreator.java │ │ │ │ │ ├── NestedLoopJoin.java │ │ │ │ │ ├── NestedLoopJoinBatch.java │ │ │ │ │ ├── NestedLoopJoinBatchCreator.java │ │ │ │ │ ├── NestedLoopJoinTemplate.java │ │ │ │ │ ├── RowKeyJoin.java │ │ │ │ │ ├── RowKeyJoinBatch.java │ │ │ │ │ └── RowKeyJoinBatchCreator.java │ │ │ │ ├── limit │ │ │ │ │ ├── LimitBatchCreator.java │ │ │ │ │ ├── LimitRecordBatch.java │ │ │ │ │ ├── PartitionLimitBatchCreator.java │ │ │ │ │ └── PartitionLimitRecordBatch.java │ │ │ │ ├── materialize │ │ │ │ │ ├── QueryWritableBatch.java │ │ │ │ │ ├── RecordMaterializer.java │ │ │ │ │ └── VectorRecordMaterializer.java │ │ │ │ ├── mergereceiver │ │ │ │ │ ├── MergingReceiverGeneratorBase.java │ │ │ │ │ ├── MergingReceiverTemplate.java │ │ │ │ │ └── MergingRecordBatch.java │ │ │ │ ├── orderedpartitioner │ │ │ │ │ ├── OrderedPartitionProjector.java │ │ │ │ │ ├── OrderedPartitionProjectorTemplate.java │ │ │ │ │ ├── OrderedPartitionRecordBatch.java │ │ │ │ │ ├── OrderedPartitionSenderCreator.java │ │ │ │ │ ├── SampleCopier.java │ │ │ │ │ ├── SampleCopierTemplate.java │ │ │ │ │ ├── SampleSortTemplate.java │ │ │ │ │ └── SampleSorter.java │ │ │ │ ├── partitionsender │ │ │ │ │ ├── PartitionOutgoingBatch.java │ │ │ │ │ ├── PartitionSenderCreator.java │ │ │ │ │ ├── PartitionSenderRootExec.java │ │ │ │ │ ├── Partitioner.java │ │ │ │ │ ├── PartitionerDecorator.java │ │ │ │ │ └── PartitionerTemplate.java │ │ │ │ ├── producer │ │ │ │ │ ├── ProducerConsumerBatch.java │ │ │ │ │ └── ProducerConsumerBatchCreator.java │ │ │ │ ├── project │ │ │ │ │ ├── ComplexToJsonBatchCreator.java │ │ │ │ │ ├── OutputSizeEstimateConstants.java │ │ │ │ │ ├── OutputWidthExpression.java │ │ │ │ │ ├── OutputWidthVisitor.java │ │ │ │ │ ├── OutputWidthVisitorState.java │ │ │ │ │ ├── ProjectBatchCreator.java │ │ │ │ │ ├── ProjectMemoryManager.java │ │ │ │ │ ├── ProjectRecordBatch.java │ │ │ │ │ ├── Projector.java │ │ │ │ │ └── ProjectorTemplate.java │ │ │ │ ├── protocol │ │ │ │ │ ├── BatchAccessor.java │ │ │ │ │ ├── OperatorDriver.java │ │ │ │ │ ├── OperatorExec.java │ │ │ │ │ ├── OperatorRecordBatch.java │ │ │ │ │ ├── SchemaTracker.java │ │ │ │ │ ├── VectorContainerAccessor.java │ │ │ │ │ └── package-info.java │ │ │ │ ├── rangepartitioner │ │ │ │ │ ├── RangePartitionRecordBatch.java │ │ │ │ │ └── RangePartitionSenderCreator.java │ │ │ │ ├── scan │ │ │ │ │ ├── ReaderState.java │ │ │ │ │ ├── RowBatchReader.java │ │ │ │ │ ├── ScanOperatorEvents.java │ │ │ │ │ ├── ScanOperatorExec.java │ │ │ │ │ ├── columns │ │ │ │ │ │ ├── ColumnsArrayManager.java │ │ │ │ │ │ ├── ColumnsArrayParser.java │ │ │ │ │ │ ├── ColumnsScanFramework.java │ │ │ │ │ │ ├── ColumnsSchemaNegotiator.java │ │ │ │ │ │ ├── ResolvedColumnsArrayColumn.java │ │ │ │ │ │ ├── UnresolvedColumnsArrayColumn.java │ │ │ │ │ │ └── package-info.java │ │ │ │ │ ├── file │ │ │ │ │ │ ├── FileMetadata.java │ │ │ │ │ │ ├── FileMetadataColumn.java │ │ │ │ │ │ ├── FileMetadataColumnDefn.java │ │ │ │ │ │ ├── FileMetadataColumnsParser.java │ │ │ │ │ │ ├── FileMetadataManager.java │ │ │ │ │ │ ├── FileScanFramework.java │ │ │ │ │ │ ├── MetadataColumn.java │ │ │ │ │ │ ├── PartitionColumn.java │ │ │ │ │ │ └── package-info.java │ │ │ │ │ ├── framework │ │ │ │ │ │ ├── BasicScanFactory.java │ │ │ │ │ │ ├── ManagedReader.java │ │ │ │ │ │ ├── ManagedScanFramework.java │ │ │ │ │ │ ├── SchemaNegotiator.java │ │ │ │ │ │ ├── SchemaNegotiatorImpl.java │ │ │ │ │ │ ├── ShimBatchReader.java │ │ │ │ │ │ └── package-info.java │ │ │ │ │ ├── package-info.java │ │ │ │ │ └── project │ │ │ │ │ │ ├── AbstractUnresolvedColumn.java │ │ │ │ │ │ ├── ColumnProjection.java │ │ │ │ │ │ ├── ConstantColumnLoader.java │ │ │ │ │ │ ├── ExplicitSchemaProjection.java │ │ │ │ │ │ ├── MetadataManager.java │ │ │ │ │ │ ├── NoOpMetadataManager.java │ │ │ │ │ │ ├── NullColumnBuilder.java │ │ │ │ │ │ ├── NullColumnLoader.java │ │ │ │ │ │ ├── ReaderLevelProjection.java │ │ │ │ │ │ ├── ReaderSchemaOrchestrator.java │ │ │ │ │ │ ├── ResolvedColumn.java │ │ │ │ │ │ ├── ResolvedMapColumn.java │ │ │ │ │ │ ├── ResolvedNullColumn.java │ │ │ │ │ │ ├── ResolvedTableColumn.java │ │ │ │ │ │ ├── ResolvedTuple.java │ │ │ │ │ │ ├── ScanLevelProjection.java │ │ │ │ │ │ ├── ScanSchemaOrchestrator.java │ │ │ │ │ │ ├── SchemaSmoother.java │ │ │ │ │ │ ├── SmoothingProjection.java │ │ │ │ │ │ ├── StaticColumnLoader.java │ │ │ │ │ │ ├── VectorSource.java │ │ │ │ │ │ ├── WildcardProjection.java │ │ │ │ │ │ ├── WildcardSchemaProjection.java │ │ │ │ │ │ └── package-info.java │ │ │ │ ├── sort │ │ │ │ │ ├── RecordBatchData.java │ │ │ │ │ ├── SortBatch.java │ │ │ │ │ ├── SortBatchCreator.java │ │ │ │ │ ├── SortRecordBatchBuilder.java │ │ │ │ │ ├── SortTemplate.java │ │ │ │ │ └── Sorter.java │ │ │ │ ├── spill │ │ │ │ │ ├── SpillSet.java │ │ │ │ │ └── package-info.java │ │ │ │ ├── statistics │ │ │ │ │ ├── AbstractMergedStatistic.java │ │ │ │ │ ├── AvgWidthMergedStatistic.java │ │ │ │ │ ├── CntDupsMergedStatistic.java │ │ │ │ │ ├── ColTypeMergedStatistic.java │ │ │ │ │ ├── ColumnMergedStatistic.java │ │ │ │ │ ├── HLLMergedStatistic.java │ │ │ │ │ ├── MergedStatistic.java │ │ │ │ │ ├── MergedStatisticFactory.java │ │ │ │ │ ├── NDVMergedStatistic.java │ │ │ │ │ ├── NNRowCountMergedStatistic.java │ │ │ │ │ ├── RowCountMergedStatistic.java │ │ │ │ │ ├── Statistic.java │ │ │ │ │ ├── StatisticsAggBatch.java │ │ │ │ │ ├── StatisticsAggBatchCreator.java │ │ │ │ │ ├── StatisticsMergeBatch.java │ │ │ │ │ ├── StatisticsMergeBatchCreator.java │ │ │ │ │ └── TDigestMergedStatistic.java │ │ │ │ ├── svremover │ │ │ │ │ ├── AbstractCopier.java │ │ │ │ │ ├── AbstractSV2Copier.java │ │ │ │ │ ├── AbstractSV4Copier.java │ │ │ │ │ ├── Copier.java │ │ │ │ │ ├── GenericCopier.java │ │ │ │ │ ├── GenericCopierFactory.java │ │ │ │ │ ├── GenericSV2Copier.java │ │ │ │ │ ├── GenericSV4Copier.java │ │ │ │ │ ├── RemovingRecordBatch.java │ │ │ │ │ ├── SVRemoverCreator.java │ │ │ │ │ └── StraightCopier.java │ │ │ │ ├── trace │ │ │ │ │ ├── TraceBatchCreator.java │ │ │ │ │ └── TraceRecordBatch.java │ │ │ │ ├── union │ │ │ │ │ ├── UnionAllBatchCreator.java │ │ │ │ │ ├── UnionAllRecordBatch.java │ │ │ │ │ ├── UnionAller.java │ │ │ │ │ └── UnionAllerTemplate.java │ │ │ │ ├── unnest │ │ │ │ │ ├── Unnest.java │ │ │ │ │ ├── UnnestBatchCreator.java │ │ │ │ │ ├── UnnestImpl.java │ │ │ │ │ └── UnnestRecordBatch.java │ │ │ │ ├── unorderedreceiver │ │ │ │ │ ├── UnorderedReceiverBatch.java │ │ │ │ │ └── UnorderedReceiverCreator.java │ │ │ │ ├── unpivot │ │ │ │ │ ├── UnpivotMapsBatchCreator.java │ │ │ │ │ └── UnpivotMapsRecordBatch.java │ │ │ │ ├── validate │ │ │ │ │ ├── BatchValidator.java │ │ │ │ │ ├── IteratorValidatorBatchIterator.java │ │ │ │ │ ├── IteratorValidatorCreator.java │ │ │ │ │ └── IteratorValidatorInjector.java │ │ │ │ ├── values │ │ │ │ │ └── ValuesBatchCreator.java │ │ │ │ ├── window │ │ │ │ │ ├── FrameSupportTemplate.java │ │ │ │ │ ├── NoFrameSupportTemplate.java │ │ │ │ │ ├── Partition.java │ │ │ │ │ ├── WindowDataBatch.java │ │ │ │ │ ├── WindowFrameBatchCreator.java │ │ │ │ │ ├── WindowFrameRecordBatch.java │ │ │ │ │ ├── WindowFramer.java │ │ │ │ │ └── WindowFunction.java │ │ │ │ └── xsort │ │ │ │ │ ├── BatchGroup.java │ │ │ │ │ ├── ExternalSortBatch.java │ │ │ │ │ ├── ExternalSortBatchCreator.java │ │ │ │ │ ├── MSortTemplate.java │ │ │ │ │ ├── MSorter.java │ │ │ │ │ ├── PriorityQueueCopier.java │ │ │ │ │ ├── PriorityQueueCopierTemplate.java │ │ │ │ │ ├── SingleBatchSorter.java │ │ │ │ │ ├── SingleBatchSorterTemplate.java │ │ │ │ │ └── managed │ │ │ │ │ ├── BaseSortWrapper.java │ │ │ │ │ ├── BaseWrapper.java │ │ │ │ │ ├── BatchGroup.java │ │ │ │ │ ├── BufferedBatches.java │ │ │ │ │ ├── ExternalSortBatch.java │ │ │ │ │ ├── MSortTemplate.java │ │ │ │ │ ├── MSorter.java │ │ │ │ │ ├── MergeSortWrapper.java │ │ │ │ │ ├── PriorityQueueCopier.java │ │ │ │ │ ├── PriorityQueueCopierTemplate.java │ │ │ │ │ ├── PriorityQueueCopierWrapper.java │ │ │ │ │ ├── SortConfig.java │ │ │ │ │ ├── SortImpl.java │ │ │ │ │ ├── SortMemoryManager.java │ │ │ │ │ ├── SortMetrics.java │ │ │ │ │ ├── SorterWrapper.java │ │ │ │ │ └── SpilledRuns.java │ │ │ └── rowSet │ │ │ │ ├── README.md │ │ │ │ ├── ResultSetLoader.java │ │ │ │ ├── ResultVectorCache.java │ │ │ │ ├── RowSetLoader.java │ │ │ │ ├── impl │ │ │ │ ├── BuildFromSchema.java │ │ │ │ ├── ColumnBuilder.java │ │ │ │ ├── ColumnState.java │ │ │ │ ├── ContainerState.java │ │ │ │ ├── DefaultSchemaTransformer.java │ │ │ │ ├── ListState.java │ │ │ │ ├── LoaderInternals.java │ │ │ │ ├── NullResultVectorCacheImpl.java │ │ │ │ ├── NullVectorState.java │ │ │ │ ├── NullableVectorState.java │ │ │ │ ├── OptionBuilder.java │ │ │ │ ├── RepeatedListState.java │ │ │ │ ├── RepeatedVectorState.java │ │ │ │ ├── ResultSetLoaderImpl.java │ │ │ │ ├── ResultVectorCacheImpl.java │ │ │ │ ├── RowSetLoaderImpl.java │ │ │ │ ├── SchemaTransformer.java │ │ │ │ ├── SchemaTransformerImpl.java │ │ │ │ ├── SingleVectorState.java │ │ │ │ ├── TupleState.java │ │ │ │ ├── UnionState.java │ │ │ │ ├── VectorState.java │ │ │ │ ├── WriterIndexImpl.java │ │ │ │ └── package-info.java │ │ │ │ ├── model │ │ │ │ ├── AbstractReaderBuilder.java │ │ │ │ ├── BaseTupleModel.java │ │ │ │ ├── ContainerVisitor.java │ │ │ │ ├── MetadataProvider.java │ │ │ │ ├── ReaderIndex.java │ │ │ │ ├── TupleModel.java │ │ │ │ ├── hyper │ │ │ │ │ ├── BaseReaderBuilder.java │ │ │ │ │ ├── HyperSchemaInference.java │ │ │ │ │ └── package-info.java │ │ │ │ ├── package-info.java │ │ │ │ └── single │ │ │ │ │ ├── BaseReaderBuilder.java │ │ │ │ │ ├── BaseWriterBuilder.java │ │ │ │ │ ├── BuildVectorsFromMetadata.java │ │ │ │ │ ├── DirectRowIndex.java │ │ │ │ │ ├── SingleSchemaInference.java │ │ │ │ │ ├── VectorAllocator.java │ │ │ │ │ └── package-info.java │ │ │ │ ├── package-info.java │ │ │ │ └── project │ │ │ │ ├── ImpliedTupleRequest.java │ │ │ │ ├── RequestedColumnImpl.java │ │ │ │ ├── RequestedTuple.java │ │ │ │ └── RequestedTupleImpl.java │ │ ├── planner │ │ │ ├── AbstractOpWrapperVisitor.java │ │ │ ├── AbstractPartitionDescriptor.java │ │ │ ├── DFSDirPartitionLocation.java │ │ │ ├── DFSFilePartitionLocation.java │ │ │ ├── DrillRelBuilder.java │ │ │ ├── FileSystemPartitionDescriptor.java │ │ │ ├── ParquetPartitionDescriptor.java │ │ │ ├── ParquetPartitionLocation.java │ │ │ ├── PartitionDescriptor.java │ │ │ ├── PartitionLocation.java │ │ │ ├── PhysicalPlanReader.java │ │ │ ├── PlannerPhase.java │ │ │ ├── PlannerType.java │ │ │ ├── RuleInstance.java │ │ │ ├── SimplePartitionLocation.java │ │ │ ├── SqlPlanner.java │ │ │ ├── StarColumnHelper.java │ │ │ ├── common │ │ │ │ ├── CountToDirectScanUtils.java │ │ │ │ ├── DrillAggregateRelBase.java │ │ │ │ ├── DrillFilterRelBase.java │ │ │ │ ├── DrillJoinRelBase.java │ │ │ │ ├── DrillLateralJoinRelBase.java │ │ │ │ ├── DrillLimitRelBase.java │ │ │ │ ├── DrillProjectRelBase.java │ │ │ │ ├── DrillRelNode.java │ │ │ │ ├── DrillRelOptUtil.java │ │ │ │ ├── DrillScanRelBase.java │ │ │ │ ├── DrillScreenRelBase.java │ │ │ │ ├── DrillStatsTable.java │ │ │ │ ├── DrillStoreRelBase.java │ │ │ │ ├── DrillUnionRelBase.java │ │ │ │ ├── DrillUnnestRelBase.java │ │ │ │ ├── DrillValuesRelBase.java │ │ │ │ ├── DrillWindowRelBase.java │ │ │ │ ├── DrillWriterRelBase.java │ │ │ │ ├── Histogram.java │ │ │ │ ├── HistogramUtils.java │ │ │ │ ├── JoinControl.java │ │ │ │ ├── NumericEquiDepthHistogram.java │ │ │ │ └── OrderedRel.java │ │ │ ├── cost │ │ │ │ ├── DrillCostBase.java │ │ │ │ ├── DrillDefaultRelMetadataProvider.java │ │ │ │ ├── DrillRelMdDistinctRowCount.java │ │ │ │ ├── DrillRelMdRowCount.java │ │ │ │ ├── DrillRelMdSelectivity.java │ │ │ │ ├── DrillRelOptCost.java │ │ │ │ ├── DrillRelOptCostFactory.java │ │ │ │ ├── NodeResource.java │ │ │ │ ├── PluginCost.java │ │ │ │ └── PrelCostEstimates.java │ │ │ ├── fragment │ │ │ │ ├── DefaultQueryParallelizer.java │ │ │ │ ├── DistributionAffinity.java │ │ │ │ ├── Fragment.java │ │ │ │ ├── FragmentParallelizer.java │ │ │ │ ├── FragmentVisitor.java │ │ │ │ ├── HardAffinityFragmentParallelizer.java │ │ │ │ ├── MakeFragmentsVisitor.java │ │ │ │ ├── Materializer.java │ │ │ │ ├── MemoryCalculator.java │ │ │ │ ├── ParallelizationInfo.java │ │ │ │ ├── ParallelizationParameters.java │ │ │ │ ├── PlanningSet.java │ │ │ │ ├── QueryParallelizer.java │ │ │ │ ├── QueueQueryParallelizer.java │ │ │ │ ├── SimpleParallelizer.java │ │ │ │ ├── SoftAffinityFragmentParallelizer.java │ │ │ │ ├── Stats.java │ │ │ │ ├── StatsCollector.java │ │ │ │ ├── Wrapper.java │ │ │ │ └── contrib │ │ │ │ │ ├── ExchangeRemoverMaterializer.java │ │ │ │ │ ├── OperatorIdVisitor.java │ │ │ │ │ └── SplittingParallelizer.java │ │ │ ├── index │ │ │ │ ├── AbstractIndexCollection.java │ │ │ │ ├── AbstractIndexDescriptor.java │ │ │ │ ├── AbstractIndexStatistics.java │ │ │ │ ├── CollationContext.java │ │ │ │ ├── DrillIndexCollection.java │ │ │ │ ├── DrillIndexDefinition.java │ │ │ │ ├── DrillIndexDescriptor.java │ │ │ │ ├── ExprToRex.java │ │ │ │ ├── FindFiltersForCollation.java │ │ │ │ ├── FunctionalIndexHelper.java │ │ │ │ ├── FunctionalIndexInfo.java │ │ │ │ ├── IndexCallContext.java │ │ │ │ ├── IndexCollection.java │ │ │ │ ├── IndexConditionInfo.java │ │ │ │ ├── IndexDefinition.java │ │ │ │ ├── IndexDescriptor.java │ │ │ │ ├── IndexDiscover.java │ │ │ │ ├── IndexDiscoverBase.java │ │ │ │ ├── IndexDiscoverFactory.java │ │ │ │ ├── IndexDiscoverable.java │ │ │ │ ├── IndexGroup.java │ │ │ │ ├── IndexLogicalPlanCallContext.java │ │ │ │ ├── IndexPhysicalPlanCallContext.java │ │ │ │ ├── IndexPlanUtils.java │ │ │ │ ├── IndexProperties.java │ │ │ │ ├── IndexSelector.java │ │ │ │ ├── IndexStatistics.java │ │ │ │ ├── IndexableExprMarker.java │ │ │ │ ├── InvalidIndexDefinitionException.java │ │ │ │ ├── PathInExpr.java │ │ │ │ ├── RexSeparator.java │ │ │ │ ├── RexToExpression.java │ │ │ │ ├── SimpleRexRemap.java │ │ │ │ ├── Statistics.java │ │ │ │ ├── StatisticsPayload.java │ │ │ │ ├── generators │ │ │ │ │ ├── AbstractIndexPlanGenerator.java │ │ │ │ │ ├── CoveringIndexPlanGenerator.java │ │ │ │ │ ├── CoveringPlanNoFilterGenerator.java │ │ │ │ │ ├── IndexIntersectPlanGenerator.java │ │ │ │ │ └── NonCoveringIndexPlanGenerator.java │ │ │ │ └── rules │ │ │ │ │ ├── AbstractMatchFunction.java │ │ │ │ │ ├── DbScanSortRemovalRule.java │ │ │ │ │ ├── DbScanToIndexScanPrule.java │ │ │ │ │ └── MatchFunction.java │ │ │ ├── logical │ │ │ │ ├── ConvertCountToDirectScanRule.java │ │ │ │ ├── CreateTableEntry.java │ │ │ │ ├── DirPrunedEnumerableTableScan.java │ │ │ │ ├── DrillAggregateRel.java │ │ │ │ ├── DrillAggregateRule.java │ │ │ │ ├── DrillAnalyzeRel.java │ │ │ │ ├── DrillConditions.java │ │ │ │ ├── DrillConstExecutor.java │ │ │ │ ├── DrillCorrelateRule.java │ │ │ │ ├── DrillDirectScanRel.java │ │ │ │ ├── DrillFilterAggregateTransposeRule.java │ │ │ │ ├── DrillFilterItemStarReWriterRule.java │ │ │ │ ├── DrillFilterJoinRules.java │ │ │ │ ├── DrillFilterRel.java │ │ │ │ ├── DrillFilterRule.java │ │ │ │ ├── DrillImplementor.java │ │ │ │ ├── DrillJoin.java │ │ │ │ ├── DrillJoinRel.java │ │ │ │ ├── DrillJoinRule.java │ │ │ │ ├── DrillLateralJoinRel.java │ │ │ │ ├── DrillLimitRel.java │ │ │ │ ├── DrillLimitRule.java │ │ │ │ ├── DrillMergeFilterRule.java │ │ │ │ ├── DrillMergeProjectRule.java │ │ │ │ ├── DrillOptiq.java │ │ │ │ ├── DrillParseContext.java │ │ │ │ ├── DrillProjectLateralJoinTransposeRule.java │ │ │ │ ├── DrillProjectPushIntoLateralJoinRule.java │ │ │ │ ├── DrillProjectRel.java │ │ │ │ ├── DrillProjectRule.java │ │ │ │ ├── DrillPushFilterPastProjectRule.java │ │ │ │ ├── DrillPushLimitToScanRule.java │ │ │ │ ├── DrillPushProjectIntoScanRule.java │ │ │ │ ├── DrillPushProjectPastFilterRule.java │ │ │ │ ├── DrillPushProjectPastJoinRule.java │ │ │ │ ├── DrillPushRowKeyJoinToScanRule.java │ │ │ │ ├── DrillReduceAggregatesRule.java │ │ │ │ ├── DrillReduceExpressionsRule.java │ │ │ │ ├── DrillRel.java │ │ │ │ ├── DrillRelFactories.java │ │ │ │ ├── DrillScanRel.java │ │ │ │ ├── DrillScanRule.java │ │ │ │ ├── DrillScreenRel.java │ │ │ │ ├── DrillSemiJoinRel.java │ │ │ │ ├── DrillSortRel.java │ │ │ │ ├── DrillSortRule.java │ │ │ │ ├── DrillStoreRel.java │ │ │ │ ├── DrillTable.java │ │ │ │ ├── DrillTranslatableTable.java │ │ │ │ ├── DrillUnionAllRule.java │ │ │ │ ├── DrillUnionRel.java │ │ │ │ ├── DrillUnnestRel.java │ │ │ │ ├── DrillUnnestRule.java │ │ │ │ ├── DrillValuesRel.java │ │ │ │ ├── DrillValuesRule.java │ │ │ │ ├── DrillViewInfoProvider.java │ │ │ │ ├── DrillViewTable.java │ │ │ │ ├── DrillWindowRel.java │ │ │ │ ├── DrillWindowRule.java │ │ │ │ ├── DrillWriterRel.java │ │ │ │ ├── DynamicDrillTable.java │ │ │ │ ├── EnumerableDrillRule.java │ │ │ │ ├── ExprHelper.java │ │ │ │ ├── ExtendableRelDataType.java │ │ │ │ ├── FieldsReWriterUtil.java │ │ │ │ ├── FileSystemCreateTableEntry.java │ │ │ │ ├── PreProcessLogicalRel.java │ │ │ │ ├── RelOptHelper.java │ │ │ │ ├── RowKeyJoinCallContext.java │ │ │ │ ├── RowKeyJoinRel.java │ │ │ │ ├── ScanFieldDeterminer.java │ │ │ │ ├── StoragePlugins.java │ │ │ │ └── partition │ │ │ │ │ ├── FindPartitionConditions.java │ │ │ │ │ ├── ParquetPruneScanRule.java │ │ │ │ │ ├── PruneScanRule.java │ │ │ │ │ ├── RewriteAsBinaryOperators.java │ │ │ │ │ └── RewriteCombineBinaryOperators.java │ │ │ ├── physical │ │ │ │ ├── AbstractRangePartitionFunction.java │ │ │ │ ├── AggPrelBase.java │ │ │ │ ├── AggPruleBase.java │ │ │ │ ├── AnalyzePrule.java │ │ │ │ ├── BroadcastExchangePrel.java │ │ │ │ ├── ComplexToJsonPrel.java │ │ │ │ ├── ConvertCountToDirectScanPrule.java │ │ │ │ ├── DirectScanPrel.java │ │ │ │ ├── DirectScanPrule.java │ │ │ │ ├── DrillDistributionTrait.java │ │ │ │ ├── DrillDistributionTraitDef.java │ │ │ │ ├── DrillScanPrel.java │ │ │ │ ├── ExchangePrel.java │ │ │ │ ├── FilterPrel.java │ │ │ │ ├── FilterPrule.java │ │ │ │ ├── FlattenPrel.java │ │ │ │ ├── HasDistributionAffinity.java │ │ │ │ ├── HashAggPrel.java │ │ │ │ ├── HashAggPrule.java │ │ │ │ ├── HashJoinPrel.java │ │ │ │ ├── HashJoinPrule.java │ │ │ │ ├── HashPrelUtil.java │ │ │ │ ├── HashToMergeExchangePrel.java │ │ │ │ ├── HashToRandomExchangePrel.java │ │ │ │ ├── JoinPrel.java │ │ │ │ ├── JoinPruleBase.java │ │ │ │ ├── LateralJoinPrel.java │ │ │ │ ├── LateralJoinPrule.java │ │ │ │ ├── LimitExchangeTransposeRule.java │ │ │ │ ├── LimitPrel.java │ │ │ │ ├── LimitPrule.java │ │ │ │ ├── MergeJoinPrel.java │ │ │ │ ├── MergeJoinPrule.java │ │ │ │ ├── NestedLoopJoinPrel.java │ │ │ │ ├── NestedLoopJoinPrule.java │ │ │ │ ├── OrderedMuxExchangePrel.java │ │ │ │ ├── OrderedPartitionExchangePrel.java │ │ │ │ ├── PartitionFunction.java │ │ │ │ ├── PhysicalPlanCreator.java │ │ │ │ ├── PlannerSettings.java │ │ │ │ ├── Prel.java │ │ │ │ ├── PrelFactories.java │ │ │ │ ├── PrelUtil.java │ │ │ │ ├── ProducerConsumerPrel.java │ │ │ │ ├── ProjectAllowDupPrel.java │ │ │ │ ├── ProjectPrel.java │ │ │ │ ├── ProjectPrule.java │ │ │ │ ├── Prule.java │ │ │ │ ├── PushLimitToTopN.java │ │ │ │ ├── RangePartitionExchangePrel.java │ │ │ │ ├── RowKeyJoinPrel.java │ │ │ │ ├── RowKeyJoinPrule.java │ │ │ │ ├── RuntimeFilterPrel.java │ │ │ │ ├── ScanPrel.java │ │ │ │ ├── ScanPrule.java │ │ │ │ ├── ScreenPrel.java │ │ │ │ ├── ScreenPrule.java │ │ │ │ ├── SelectionVectorRemoverPrel.java │ │ │ │ ├── SingleMergeExchangePrel.java │ │ │ │ ├── SinglePrel.java │ │ │ │ ├── SortConvertPrule.java │ │ │ │ ├── SortPrel.java │ │ │ │ ├── SortPrule.java │ │ │ │ ├── StatsAggPrel.java │ │ │ │ ├── StatsMergePrel.java │ │ │ │ ├── StreamAggPrel.java │ │ │ │ ├── StreamAggPrule.java │ │ │ │ ├── SubsetTransformer.java │ │ │ │ ├── TopNPrel.java │ │ │ │ ├── UnionAllPrel.java │ │ │ │ ├── UnionAllPrule.java │ │ │ │ ├── UnionDistinctPrel.java │ │ │ │ ├── UnionDistinctPrule.java │ │ │ │ ├── UnionExchangePrel.java │ │ │ │ ├── UnionPrel.java │ │ │ │ ├── UnnestPrel.java │ │ │ │ ├── UnnestPrule.java │ │ │ │ ├── UnorderedDeMuxExchangePrel.java │ │ │ │ ├── UnorderedMuxExchangePrel.java │ │ │ │ ├── UnpivotMapsPrel.java │ │ │ │ ├── ValuesPrel.java │ │ │ │ ├── ValuesPrule.java │ │ │ │ ├── WindowPrel.java │ │ │ │ ├── WindowPrule.java │ │ │ │ ├── WriterPrel.java │ │ │ │ ├── WriterPrule.java │ │ │ │ ├── explain │ │ │ │ │ ├── NumberingRelWriter.java │ │ │ │ │ └── PrelSequencer.java │ │ │ │ └── visitor │ │ │ │ │ ├── AdjustOperatorsSchemaVisitor.java │ │ │ │ │ ├── BasePrelVisitor.java │ │ │ │ │ ├── ComplexToJsonPrelVisitor.java │ │ │ │ │ ├── ExcessiveExchangeIdentifier.java │ │ │ │ │ ├── FinalColumnReorderer.java │ │ │ │ │ ├── InsertLocalExchangeVisitor.java │ │ │ │ │ ├── LateralUnnestRowIDVisitor.java │ │ │ │ │ ├── MemoryEstimationVisitor.java │ │ │ │ │ ├── PrelVisitor.java │ │ │ │ │ ├── PrelVisualizerVisitor.java │ │ │ │ │ ├── ProducerConsumerPrelVisitor.java │ │ │ │ │ ├── RelUniqifier.java │ │ │ │ │ ├── RewriteProjectToFlatten.java │ │ │ │ │ ├── RexVisitorComplexExprSplitter.java │ │ │ │ │ ├── RuntimeFilterVisitor.java │ │ │ │ │ ├── SelectionVectorPrelVisitor.java │ │ │ │ │ ├── SplitUpComplexExpressions.java │ │ │ │ │ ├── StarColumnConverter.java │ │ │ │ │ ├── SwapHashJoinVisitor.java │ │ │ │ │ └── TopProjectVisitor.java │ │ │ ├── sql │ │ │ │ ├── Checker.java │ │ │ │ ├── DrillAvgVarianceConvertlet.java │ │ │ │ ├── DrillCalciteSqlAggFunctionWrapper.java │ │ │ │ ├── DrillCalciteSqlBetweenOperatorWrapper.java │ │ │ │ ├── DrillCalciteSqlFunctionWrapper.java │ │ │ │ ├── DrillCalciteSqlOperatorWrapper.java │ │ │ │ ├── DrillCalciteSqlWrapper.java │ │ │ │ ├── DrillConformance.java │ │ │ │ ├── DrillConvertletTable.java │ │ │ │ ├── DrillExtractConvertlet.java │ │ │ │ ├── DrillOperatorTable.java │ │ │ │ ├── DrillParserConfig.java │ │ │ │ ├── DrillSqlAggOperator.java │ │ │ │ ├── DrillSqlAggOperatorWithoutInference.java │ │ │ │ ├── DrillSqlOperator.java │ │ │ │ ├── DrillSqlOperatorWithoutInference.java │ │ │ │ ├── DynamicReturnType.java │ │ │ │ ├── DynamicType.java │ │ │ │ ├── ExpandingConcurrentMap.java │ │ │ │ ├── FixedRange.java │ │ │ │ ├── QueryInputException.java │ │ │ │ ├── SchemaUtilites.java │ │ │ │ ├── SqlConverter.java │ │ │ │ ├── TypeInferenceUtils.java │ │ │ │ ├── handlers │ │ │ │ │ ├── AbstractSqlHandler.java │ │ │ │ │ ├── AnalyzeTableHandler.java │ │ │ │ │ ├── ComplexUnnestVisitor.java │ │ │ │ │ ├── CreateFunctionHandler.java │ │ │ │ │ ├── CreateTableHandler.java │ │ │ │ │ ├── DefaultSqlHandler.java │ │ │ │ │ ├── DescribeSchemaHandler.java │ │ │ │ │ ├── DescribeTableHandler.java │ │ │ │ │ ├── DropFunctionHandler.java │ │ │ │ │ ├── DropTableHandler.java │ │ │ │ │ ├── ExplainHandler.java │ │ │ │ │ ├── FindHardDistributionScans.java │ │ │ │ │ ├── FindLimit0Visitor.java │ │ │ │ │ ├── PrelFinalizable.java │ │ │ │ │ ├── RefreshMetadataHandler.java │ │ │ │ │ ├── SchemaHandler.java │ │ │ │ │ ├── SetOptionHandler.java │ │ │ │ │ ├── ShowFilesHandler.java │ │ │ │ │ ├── ShowSchemasHandler.java │ │ │ │ │ ├── ShowTablesHandler.java │ │ │ │ │ ├── SimpleCommandResult.java │ │ │ │ │ ├── SqlHandlerConfig.java │ │ │ │ │ ├── SqlHandlerUtil.java │ │ │ │ │ ├── UseSchemaHandler.java │ │ │ │ │ └── ViewHandler.java │ │ │ │ └── parser │ │ │ │ │ ├── CompoundIdentifierConverter.java │ │ │ │ │ ├── DrillCalciteWrapperUtility.java │ │ │ │ │ ├── DrillCompoundIdentifier.java │ │ │ │ │ ├── DrillParserUtil.java │ │ │ │ │ ├── DrillSqlCall.java │ │ │ │ │ ├── DrillSqlDescribeTable.java │ │ │ │ │ ├── SqlAnalyzeTable.java │ │ │ │ │ ├── SqlCreateFunction.java │ │ │ │ │ ├── SqlCreateTable.java │ │ │ │ │ ├── SqlCreateType.java │ │ │ │ │ ├── SqlCreateView.java │ │ │ │ │ ├── SqlDropFunction.java │ │ │ │ │ ├── SqlDropTable.java │ │ │ │ │ ├── SqlDropView.java │ │ │ │ │ ├── SqlRefreshMetadata.java │ │ │ │ │ ├── SqlSchema.java │ │ │ │ │ ├── SqlShowFiles.java │ │ │ │ │ ├── SqlShowSchemas.java │ │ │ │ │ ├── SqlShowTables.java │ │ │ │ │ ├── SqlUseSchema.java │ │ │ │ │ ├── UnsupportedOperatorsVisitor.java │ │ │ │ │ └── impl │ │ │ │ │ └── DrillParserWithCompoundIdConverter.java │ │ │ ├── torel │ │ │ │ └── ConversionContext.java │ │ │ └── types │ │ │ │ ├── AbstractRelDataTypeHolder.java │ │ │ │ ├── DrillFixedRelDataTypeImpl.java │ │ │ │ ├── DrillRelDataTypeSystem.java │ │ │ │ ├── ExtendableRelDataTypeHolder.java │ │ │ │ ├── RelDataTypeDrillImpl.java │ │ │ │ ├── RelDataTypeHolder.java │ │ │ │ └── decimal │ │ │ │ ├── DecimalScalePrecisionAddFunction.java │ │ │ │ ├── DecimalScalePrecisionDivideFunction.java │ │ │ │ ├── DecimalScalePrecisionModFunction.java │ │ │ │ ├── DecimalScalePrecisionMulFunction.java │ │ │ │ └── DrillBaseComputeScalePrecision.java │ │ ├── proto │ │ │ └── helper │ │ │ │ └── QueryIdHelper.java │ │ ├── record │ │ │ ├── AbstractBinaryRecordBatch.java │ │ │ ├── AbstractRecordBatch.java │ │ │ ├── AbstractSingleRecordBatch.java │ │ │ ├── AbstractTableFunctionRecordBatch.java │ │ │ ├── AbstractUnaryRecordBatch.java │ │ │ ├── BatchSchema.java │ │ │ ├── CloseableRecordBatch.java │ │ │ ├── DeadBuf.java │ │ │ ├── ExpandableHyperContainer.java │ │ │ ├── FragmentWritableBatch.java │ │ │ ├── HyperVectorWrapper.java │ │ │ ├── JoinBatchMemoryManager.java │ │ │ ├── MajorTypeSerDe.java │ │ │ ├── MaterializeVisitor.java │ │ │ ├── RawFragmentBatch.java │ │ │ ├── RawFragmentBatchProvider.java │ │ │ ├── RecordBatch.java │ │ │ ├── RecordBatchLoader.java │ │ │ ├── RecordBatchMemoryManager.java │ │ │ ├── RecordBatchSizer.java │ │ │ ├── RecordIterator.java │ │ │ ├── SchemaBuilder.java │ │ │ ├── SchemaUtil.java │ │ │ ├── SchemalessBatch.java │ │ │ ├── SimpleRecordBatch.java │ │ │ ├── SimpleVectorWrapper.java │ │ │ ├── TableFunctionContract.java │ │ │ ├── TypedFieldId.java │ │ │ ├── VectorAccessible.java │ │ │ ├── VectorAccessibleComplexWriter.java │ │ │ ├── VectorAccessibleUtilities.java │ │ │ ├── VectorContainer.java │ │ │ ├── VectorInitializer.java │ │ │ ├── VectorWrapper.java │ │ │ ├── WritableBatch.java │ │ │ ├── metadata │ │ │ │ ├── AbstractColumnMetadata.java │ │ │ │ ├── ColumnBuilder.java │ │ │ │ ├── MapBuilder.java │ │ │ │ ├── MapColumnMetadata.java │ │ │ │ ├── MetadataUtils.java │ │ │ │ ├── PrimitiveColumnMetadata.java │ │ │ │ ├── PropertyAccessor.java │ │ │ │ ├── RepeatedListBuilder.java │ │ │ │ ├── RepeatedListColumnMetadata.java │ │ │ │ ├── SchemaBuilder.java │ │ │ │ ├── SchemaContainer.java │ │ │ │ ├── SchemaPathUtils.java │ │ │ │ ├── TupleBuilder.java │ │ │ │ ├── TupleSchema.java │ │ │ │ ├── UnionBuilder.java │ │ │ │ ├── VariantColumnMetadata.java │ │ │ │ ├── VariantSchema.java │ │ │ │ ├── package-info.java │ │ │ │ └── schema │ │ │ │ │ ├── FsMetastoreSchemaProvider.java │ │ │ │ │ ├── InlineSchemaProvider.java │ │ │ │ │ ├── PathSchemaProvider.java │ │ │ │ │ ├── SchemaContainer.java │ │ │ │ │ ├── SchemaProvider.java │ │ │ │ │ └── parser │ │ │ │ │ ├── SchemaExprParser.java │ │ │ │ │ ├── SchemaParsingException.java │ │ │ │ │ ├── SchemaVisitor.java │ │ │ │ │ └── UpperCaseCharStream.java │ │ │ └── selection │ │ │ │ ├── SelectionVector2.java │ │ │ │ ├── SelectionVector4.java │ │ │ │ └── SelectionVector4Builder.java │ │ ├── resolver │ │ │ ├── DefaultFunctionResolver.java │ │ │ ├── ExactFunctionResolver.java │ │ │ ├── FunctionResolver.java │ │ │ ├── FunctionResolverFactory.java │ │ │ ├── ResolverTypePrecedence.java │ │ │ └── TypeCastRules.java │ │ ├── serialization │ │ │ ├── InstanceSerializer.java │ │ │ ├── JacksonSerializer.java │ │ │ ├── PathSerDe.java │ │ │ └── ProtoSerializer.java │ │ ├── session │ │ │ ├── UserClientConnection.java │ │ │ └── UserSession.java │ │ ├── store │ │ │ ├── AbstractRecordReader.java │ │ │ ├── AbstractSchema.java │ │ │ ├── AbstractSchemaFactory.java │ │ │ ├── AbstractStoragePlugin.java │ │ │ ├── BatchExceededException.java │ │ │ ├── ClassPathFileSystem.java │ │ │ ├── ColumnExplorer.java │ │ │ ├── DistributedStorageEngine.java │ │ │ ├── DynamicRootSchema.java │ │ │ ├── DynamicSchema.java │ │ │ ├── LocalSyncableFileSystem.java │ │ │ ├── NamedStoragePluginConfig.java │ │ │ ├── PartitionExplorer.java │ │ │ ├── PartitionExplorerImpl.java │ │ │ ├── PartitionNotFoundException.java │ │ │ ├── RecordDataType.java │ │ │ ├── RecordReader.java │ │ │ ├── ResourceInputStream.java │ │ │ ├── SchemaConfig.java │ │ │ ├── SchemaFactory.java │ │ │ ├── SchemaPartitionExplorer.java │ │ │ ├── SchemaTreeProvider.java │ │ │ ├── StoragePlugin.java │ │ │ ├── StoragePluginMap.java │ │ │ ├── StoragePluginOptimizerRule.java │ │ │ ├── StoragePluginRegistry.java │ │ │ ├── StoragePluginRegistryImpl.java │ │ │ ├── StoragePluginsHandler.java │ │ │ ├── StoragePluginsHandlerService.java │ │ │ ├── StorageStrategy.java │ │ │ ├── SubSchemaWrapper.java │ │ │ ├── SystemPlugin.java │ │ │ ├── TimedCallable.java │ │ │ ├── dfs │ │ │ │ ├── BasicFormatMatcher.java │ │ │ │ ├── DrillFSDataInputStream.java │ │ │ │ ├── DrillFileSystem.java │ │ │ │ ├── FileSelection.java │ │ │ │ ├── FileSystemConfig.java │ │ │ │ ├── FileSystemPlugin.java │ │ │ │ ├── FileSystemSchemaFactory.java │ │ │ │ ├── FormatCreator.java │ │ │ │ ├── FormatMatcher.java │ │ │ │ ├── FormatPlugin.java │ │ │ │ ├── FormatPluginOptionExtractor.java │ │ │ │ ├── FormatPluginOptionsDescriptor.java │ │ │ │ ├── FormatSelection.java │ │ │ │ ├── MagicString.java │ │ │ │ ├── MetadataContext.java │ │ │ │ ├── NamedFormatPluginConfig.java │ │ │ │ ├── OpenFileTracker.java │ │ │ │ ├── ReadEntryFromHDFS.java │ │ │ │ ├── ReadEntryWithPath.java │ │ │ │ ├── SubDirectoryList.java │ │ │ │ ├── WorkspaceConfig.java │ │ │ │ ├── WorkspaceSchemaFactory.java │ │ │ │ ├── easy │ │ │ │ │ ├── EasyFormatPlugin.java │ │ │ │ │ ├── EasyGroupScan.java │ │ │ │ │ ├── EasyReaderBatchCreator.java │ │ │ │ │ ├── EasySubScan.java │ │ │ │ │ ├── EasyWriter.java │ │ │ │ │ ├── EasyWriterBatchCreator.java │ │ │ │ │ ├── FileWork.java │ │ │ │ │ └── SimpleFileTableMetadataProviderBuilder.java │ │ │ │ ├── json │ │ │ │ │ ├── JSONFormatPlugin.java │ │ │ │ │ ├── JSONRecordReader.java │ │ │ │ │ ├── JsonProcessor.java │ │ │ │ │ ├── JsonRecordWriter.java │ │ │ │ │ ├── JsonStatisticsRecordWriter.java │ │ │ │ │ └── reader │ │ │ │ │ │ ├── BaseJsonProcessor.java │ │ │ │ │ │ └── CountingJsonReader.java │ │ │ │ └── text │ │ │ │ │ ├── TextFormatPlugin.java │ │ │ │ │ ├── reader │ │ │ │ │ ├── BaseFieldOutput.java │ │ │ │ │ ├── CompliantTextBatchReader.java │ │ │ │ │ ├── FieldVarCharOutput.java │ │ │ │ │ ├── HeaderBuilder.java │ │ │ │ │ ├── RepeatedVarCharOutput.java │ │ │ │ │ ├── StreamFinishedPseudoException.java │ │ │ │ │ ├── TextInput.java │ │ │ │ │ ├── TextOutput.java │ │ │ │ │ ├── TextParsingContext.java │ │ │ │ │ ├── TextParsingSettings.java │ │ │ │ │ ├── TextReader.java │ │ │ │ │ └── package-info.java │ │ │ │ │ └── writer │ │ │ │ │ └── TextRecordWriter.java │ │ │ ├── direct │ │ │ │ ├── DirectBatchCreator.java │ │ │ │ ├── DirectGroupScan.java │ │ │ │ ├── DirectSubScan.java │ │ │ │ └── MetadataDirectGroupScan.java │ │ │ ├── ischema │ │ │ │ ├── InfoSchemaBatchCreator.java │ │ │ │ ├── InfoSchemaConfig.java │ │ │ │ ├── InfoSchemaConstants.java │ │ │ │ ├── InfoSchemaDrillTable.java │ │ │ │ ├── InfoSchemaFilter.java │ │ │ │ ├── InfoSchemaFilterBuilder.java │ │ │ │ ├── InfoSchemaGroupScan.java │ │ │ │ ├── InfoSchemaPushFilterIntoRecordGenerator.java │ │ │ │ ├── InfoSchemaRecordGenerator.java │ │ │ │ ├── InfoSchemaStoragePlugin.java │ │ │ │ ├── InfoSchemaSubScan.java │ │ │ │ ├── InfoSchemaTable.java │ │ │ │ ├── InfoSchemaTableType.java │ │ │ │ ├── Records.java │ │ │ │ └── package-info.java │ │ │ ├── parquet │ │ │ │ ├── AbstractParquetGroupScan.java │ │ │ │ ├── AbstractParquetRowGroupScan.java │ │ │ │ ├── AbstractParquetScanBatchCreator.java │ │ │ │ ├── BaseParquetMetadataProvider.java │ │ │ │ ├── ColumnDataReader.java │ │ │ │ ├── FilterEvaluatorUtils.java │ │ │ │ ├── FooterGatherer.java │ │ │ │ ├── ParquetDirectByteBufferAllocator.java │ │ │ │ ├── ParquetFileTableMetadataProviderBuilder.java │ │ │ │ ├── ParquetFormatConfig.java │ │ │ │ ├── ParquetFormatPlugin.java │ │ │ │ ├── ParquetGroupScan.java │ │ │ │ ├── ParquetGroupScanStatistics.java │ │ │ │ ├── ParquetPushDownFilter.java │ │ │ │ ├── ParquetReaderConfig.java │ │ │ │ ├── ParquetReaderStats.java │ │ │ │ ├── ParquetReaderUtility.java │ │ │ │ ├── ParquetRecordWriter.java │ │ │ │ ├── ParquetRowGroupScan.java │ │ │ │ ├── ParquetScanBatchCreator.java │ │ │ │ ├── ParquetTableMetadataProviderImpl.java │ │ │ │ ├── ParquetTableMetadataUtils.java │ │ │ │ ├── ParquetWriter.java │ │ │ │ ├── ParquetWriterBatchCreator.java │ │ │ │ ├── RowGroupInfo.java │ │ │ │ ├── RowGroupReadEntry.java │ │ │ │ ├── columnreaders │ │ │ │ │ ├── AsyncPageReader.java │ │ │ │ │ ├── BatchReader.java │ │ │ │ │ ├── BitReader.java │ │ │ │ │ ├── ColumnReader.java │ │ │ │ │ ├── ColumnReaderFactory.java │ │ │ │ │ ├── FixedByteAlignedReader.java │ │ │ │ │ ├── FixedWidthRepeatedReader.java │ │ │ │ │ ├── NullableBitReader.java │ │ │ │ │ ├── NullableColumnReader.java │ │ │ │ │ ├── NullableFixedByteAlignedReaders.java │ │ │ │ │ ├── NullableVarLengthValuesColumn.java │ │ │ │ │ ├── PageReader.java │ │ │ │ │ ├── ParquetColumnMetadata.java │ │ │ │ │ ├── ParquetFixedWidthDictionaryReaders.java │ │ │ │ │ ├── ParquetRecordReader.java │ │ │ │ │ ├── ParquetSchema.java │ │ │ │ │ ├── ParquetToDrillTypeConverter.java │ │ │ │ │ ├── ReadState.java │ │ │ │ │ ├── VarLenAbstractEntryReader.java │ │ │ │ │ ├── VarLenAbstractPageEntryReader.java │ │ │ │ │ ├── VarLenBinaryReader.java │ │ │ │ │ ├── VarLenBulkPageReader.java │ │ │ │ │ ├── VarLenColumnBulkEntry.java │ │ │ │ │ ├── VarLenColumnBulkInput.java │ │ │ │ │ ├── VarLenEntryDictionaryReader.java │ │ │ │ │ ├── VarLenEntryReader.java │ │ │ │ │ ├── VarLenFixedEntryReader.java │ │ │ │ │ ├── VarLenNullableDictionaryReader.java │ │ │ │ │ ├── VarLenNullableEntryReader.java │ │ │ │ │ ├── VarLenNullableFixedEntryReader.java │ │ │ │ │ ├── VarLenOverflowReader.java │ │ │ │ │ ├── VarLengthColumn.java │ │ │ │ │ ├── VarLengthColumnReaders.java │ │ │ │ │ ├── VarLengthValuesColumn.java │ │ │ │ │ └── batchsizing │ │ │ │ │ │ ├── BatchOverflowOptimizer.java │ │ │ │ │ │ ├── BatchSizingMemoryUtil.java │ │ │ │ │ │ ├── OverflowSerDeUtil.java │ │ │ │ │ │ ├── RecordBatchOverflow.java │ │ │ │ │ │ └── RecordBatchSizerManager.java │ │ │ │ ├── decimal │ │ │ │ │ ├── BinaryDecimalParquetValueWriter.java │ │ │ │ │ ├── DecimalValueWriter.java │ │ │ │ │ ├── FixedLenDecimalParquetValueWriter.java │ │ │ │ │ ├── Int32DecimalParquetValueWriter.java │ │ │ │ │ └── Int64DecimalParquetValueWriter.java │ │ │ │ ├── metadata │ │ │ │ │ ├── Metadata.java │ │ │ │ │ ├── MetadataBase.java │ │ │ │ │ ├── MetadataPathUtils.java │ │ │ │ │ ├── MetadataVersion.java │ │ │ │ │ ├── Metadata_V1.java │ │ │ │ │ ├── Metadata_V2.java │ │ │ │ │ ├── Metadata_V3.java │ │ │ │ │ ├── Metadata_V4.java │ │ │ │ │ └── ParquetTableMetadataDirs.java │ │ │ │ └── v2 │ │ │ │ │ ├── DrillParquetGroupConverter.java │ │ │ │ │ ├── DrillParquetReader.java │ │ │ │ │ └── DrillParquetRecordMaterializer.java │ │ │ ├── pojo │ │ │ │ ├── AbstractPojoRecordReader.java │ │ │ │ ├── AbstractPojoWriter.java │ │ │ │ ├── DynamicPojoRecordReader.java │ │ │ │ ├── NonNullable.java │ │ │ │ ├── PojoDataType.java │ │ │ │ ├── PojoRecordReader.java │ │ │ │ ├── PojoWriter.java │ │ │ │ └── PojoWriters.java │ │ │ ├── schedule │ │ │ │ ├── AffinityCreator.java │ │ │ │ ├── AssignmentCreator.java │ │ │ │ ├── BlockMapBuilder.java │ │ │ │ ├── CompleteFileWork.java │ │ │ │ ├── CompleteWork.java │ │ │ │ ├── EndpointByteMap.java │ │ │ │ └── EndpointByteMapImpl.java │ │ │ └── sys │ │ │ │ ├── BasePersistentStore.java │ │ │ │ ├── CaseInsensitivePersistentStore.java │ │ │ │ ├── DrillbitIterator.java │ │ │ │ ├── ExtendedOptionIterator.java │ │ │ │ ├── FunctionsIterator.java │ │ │ │ ├── MemoryIterator.java │ │ │ │ ├── OptionIterator.java │ │ │ │ ├── PersistentStore.java │ │ │ │ ├── PersistentStoreConfig.java │ │ │ │ ├── PersistentStoreMode.java │ │ │ │ ├── PersistentStoreProvider.java │ │ │ │ ├── PersistentStoreRegistry.java │ │ │ │ ├── ProfileInfoIterator.java │ │ │ │ ├── ProfileIterator.java │ │ │ │ ├── ProfileJsonIterator.java │ │ │ │ ├── StaticDrillTable.java │ │ │ │ ├── Store.java │ │ │ │ ├── SystemTable.java │ │ │ │ ├── SystemTableBatchCreator.java │ │ │ │ ├── SystemTablePlugin.java │ │ │ │ ├── SystemTablePluginConfig.java │ │ │ │ ├── SystemTableScan.java │ │ │ │ ├── ThreadsIterator.java │ │ │ │ ├── VersionIterator.java │ │ │ │ ├── VersionedPersistentStore.java │ │ │ │ └── store │ │ │ │ ├── DataChangeVersion.java │ │ │ │ ├── InMemoryStore.java │ │ │ │ ├── LocalPersistentStore.java │ │ │ │ ├── UndefinedVersionDelegatingStore.java │ │ │ │ ├── VersionedDelegatingStore.java │ │ │ │ └── provider │ │ │ │ ├── BasePersistentStoreProvider.java │ │ │ │ ├── CachingPersistentStoreProvider.java │ │ │ │ ├── InMemoryStoreProvider.java │ │ │ │ └── LocalPersistentStoreProvider.java │ │ ├── testing │ │ │ ├── ControlsInjector.java │ │ │ ├── ControlsInjectorFactory.java │ │ │ ├── CountDownLatchInjection.java │ │ │ ├── CountDownLatchInjectionImpl.java │ │ │ ├── ExceptionInjection.java │ │ │ ├── ExecutionControls.java │ │ │ ├── ExecutionControlsInjector.java │ │ │ ├── Injection.java │ │ │ ├── InjectionConfigurationException.java │ │ │ ├── InjectionSite.java │ │ │ ├── NoOpControlsInjector.java │ │ │ ├── PauseInjection.java │ │ │ └── store │ │ │ │ └── NoWriteLocalStore.java │ │ ├── util │ │ │ ├── ActionOnFile.java │ │ │ ├── ApproximateStringMatcher.java │ │ │ ├── ArrayWrappedIntIntMap.java │ │ │ ├── BatchPrinter.java │ │ │ ├── ByteBufUtil.java │ │ │ ├── DrillFileSystemUtil.java │ │ │ ├── EncodedSchemaPathSet.java │ │ │ ├── FileSystemUtil.java │ │ │ ├── ImpersonationUtil.java │ │ │ ├── JarUtil.java │ │ │ ├── MemoryAllocationUtilities.java │ │ │ ├── Pointer.java │ │ │ ├── Utilities.java │ │ │ ├── ValueVectorElementFormatter.java │ │ │ ├── VectorUtil.java │ │ │ ├── concurrent │ │ │ │ └── ExecutorServiceUtil.java │ │ │ ├── filereader │ │ │ │ ├── BufferedDirectBufInputStream.java │ │ │ │ └── DirectBufInputStream.java │ │ │ └── record │ │ │ │ └── RecordBatchStats.java │ │ ├── vector │ │ │ ├── CopyUtil.java │ │ │ ├── VectorValidator.java │ │ │ ├── accessor │ │ │ │ ├── AbstractSqlAccessor.java │ │ │ │ ├── BoundCheckingAccessor.java │ │ │ │ ├── GenericAccessor.java │ │ │ │ ├── InvalidAccessException.java │ │ │ │ ├── SqlAccessor.java │ │ │ │ ├── UnionSqlAccessor.java │ │ │ │ └── sql │ │ │ │ │ └── TimePrintMillis.java │ │ │ └── complex │ │ │ │ ├── FieldIdUtil.java │ │ │ │ ├── MapUtility.java │ │ │ │ ├── fn │ │ │ │ ├── BasicJsonOutput.java │ │ │ │ ├── DateOutputFormat.java │ │ │ │ ├── DrillBufInputStream.java │ │ │ │ ├── ExtendedJsonOutput.java │ │ │ │ ├── ExtendedType.java │ │ │ │ ├── ExtendedTypeName.java │ │ │ │ ├── FieldSelection.java │ │ │ │ ├── JsonOutput.java │ │ │ │ ├── JsonReader.java │ │ │ │ ├── JsonReaderUtils.java │ │ │ │ ├── JsonWriter.java │ │ │ │ ├── SeekableBAIS.java │ │ │ │ ├── VectorOutput.java │ │ │ │ └── WorkingBuffer.java │ │ │ │ └── impl │ │ │ │ └── VectorContainerWriter.java │ │ └── work │ │ │ ├── QueryWorkUnit.java │ │ │ ├── exception │ │ │ ├── SqlExecutorException.java │ │ │ ├── SqlExecutorSetupException.java │ │ │ ├── SqlUnsupportedException.java │ │ │ ├── UnsupportedDataTypeException.java │ │ │ ├── UnsupportedFunctionException.java │ │ │ └── UnsupportedRelOperatorException.java │ │ │ └── filter │ │ │ ├── BloomFilter.java │ │ │ ├── BloomFilterDef.java │ │ │ ├── RuntimeFilterDef.java │ │ │ ├── RuntimeFilterReporter.java │ │ │ ├── RuntimeFilterRouter.java │ │ │ ├── RuntimeFilterSink.java │ │ │ └── RuntimeFilterWritable.java │ │ └── metastore │ │ ├── BaseMetadata.java │ │ ├── CollectableColumnStatisticsKind.java │ │ ├── CollectableTableStatisticsKind.java │ │ ├── ColumnStatistics.java │ │ ├── ColumnStatisticsImpl.java │ │ ├── ColumnStatisticsKind.java │ │ ├── FileMetadata.java │ │ ├── FileTableMetadata.java │ │ ├── LocationProvider.java │ │ ├── PartitionMetadata.java │ │ ├── RowGroupMetadata.java │ │ ├── StatisticsKind.java │ │ ├── TableMetadata.java │ │ └── TableStatisticsKind.java │ └── resources │ ├── bootstrap-storage-plugins.json │ └── drill-module.conf ├── hansql-function ├── pom.xml └── src │ └── main │ ├── codegen │ ├── config.fmpp │ ├── data │ │ ├── AggrBitwiseLogicalTypes.tdd │ │ ├── AggrTypes1.tdd │ │ ├── AggrTypes2.tdd │ │ ├── AggrTypes3.tdd │ │ ├── CastHigh.tdd │ │ ├── Casts.tdd │ │ ├── ComparisonTypesDecimal.tdd │ │ ├── ComparisonTypesMain.tdd │ │ ├── CorrelationTypes.tdd │ │ ├── CountAggrTypes.tdd │ │ ├── CovarTypes.tdd │ │ ├── DateIntervalFunc.tdd │ │ ├── DecimalAggrTypes1.tdd │ │ ├── DecimalAggrTypes2.tdd │ │ ├── DecimalAggrTypes3.tdd │ │ ├── ExtractTypes.tdd │ │ ├── IntervalNumericTypes.tdd │ │ ├── MathFunc.tdd │ │ ├── MathFunctionTypes.tdd │ │ ├── NumericTypes.tdd │ │ ├── SingleValue.tdd │ │ ├── SumZero.tdd │ │ └── ValueVectorTypes.tdd │ ├── includes │ │ ├── license.ftl │ │ └── vv_imports.ftl │ └── templates │ │ ├── AggrBitwiseLogicalTypeFunctions.java │ │ ├── AggrTypeFunctions1.java │ │ ├── AggrTypeFunctions2.java │ │ ├── AggrTypeFunctions3.java │ │ ├── CastDateDate.java │ │ ├── CastDateVarChar.java │ │ ├── CastEmptyStringVarTypesToNullableNumeric.java │ │ ├── CastFunctions.java │ │ ├── CastFunctionsSrcVarLen.java │ │ ├── CastFunctionsSrcVarLenTargetVarLen.java │ │ ├── CastFunctionsTargetVarLen.java │ │ ├── CastHigh.java │ │ ├── CastIntervalInterval.java │ │ ├── CastIntervalVarChar.java │ │ ├── CastStringTypesToDate.java │ │ ├── CastStringTypesToInterval.java │ │ ├── CastUntypedNull.java │ │ ├── ComparisonFunctions.java │ │ ├── ComplexAggrFunctions1.java │ │ ├── ConvertToNullableHolder.java │ │ ├── CorrelationTypeFunctions.java │ │ ├── CountAggregateFunctions.java │ │ ├── CovarTypeFunctions.java │ │ ├── DateIntervalAggrFunctions1.java │ │ ├── DateIntervalFunctionTemplates │ │ ├── DateDateArithmeticFunctions.java │ │ ├── DateIntervalArithmeticFunctions.java │ │ ├── DateToCharFunctions.java │ │ ├── DateTruncFunctions.java │ │ ├── Extract.java │ │ ├── IntervalIntervalArithmetic.java │ │ ├── IntervalNumericArithmetic.java │ │ ├── SqlToDateTypeFunctions.java │ │ ├── TimestampDiff.java │ │ ├── ToDateTypeFunctions.java │ │ └── ToTimeStampFunction.java │ │ ├── Decimal │ │ ├── CastDecimalFloat.java │ │ ├── CastDecimalInt.java │ │ ├── CastDecimalVarDecimal.java │ │ ├── CastDecimalVarchar.java │ │ ├── CastFloatDecimal.java │ │ ├── CastIntDecimal.java │ │ ├── CastVarCharDecimal.java │ │ ├── CastVarDecimalDecimal.java │ │ ├── DecimalAggrTypeFunctions1.java │ │ ├── DecimalAggrTypeFunctions2.java │ │ ├── DecimalAggrTypeFunctions3.java │ │ └── DecimalFunctions.java │ │ ├── DirectoryExplorers.java │ │ ├── IntervalAggrFunctions2.java │ │ ├── MathFunctionTemplates.java │ │ ├── MathFunctions.java │ │ ├── NewValueFunctions.java │ │ ├── NullOperator.java │ │ ├── NumericFunctionsTemplates.java │ │ ├── NumericToCharFunctions.java │ │ ├── RepeatedCountFunctions.java │ │ ├── SingleValueAgg.java │ │ ├── SumZeroAggr.java │ │ ├── UnionFunctions.java │ │ └── VarCharAggrFunctions1.java │ ├── java │ └── org │ │ └── lealone │ │ └── hansql │ │ └── exec │ │ └── expr │ │ └── fn │ │ └── impl │ │ ├── AggregateErrorFunctions.java │ │ ├── Alternator.java │ │ ├── BitFunctions.java │ │ ├── BooleanAggrFunctions.java │ │ ├── ByteSubstring.java │ │ ├── CastBigIntDate.java │ │ ├── CastBigIntTimeStamp.java │ │ ├── CastIntTime.java │ │ ├── CastVarCharVar16Char.java │ │ ├── CharSubstring.java │ │ ├── CompareUntypedNull.java │ │ ├── ContextFunctions.java │ │ ├── DateTypeFunctions.java │ │ ├── ExceptionFunction.java │ │ ├── Hash32AsDouble.java │ │ ├── Hash32Functions.java │ │ ├── Hash32FunctionsWithSeed.java │ │ ├── Hash32WithSeedAsDouble.java │ │ ├── Hash64AsDouble.java │ │ ├── Hash64Functions.java │ │ ├── Hash64FunctionsWithSeed.java │ │ ├── Hash64WithSeedAsDouble.java │ │ ├── IsFalse.java │ │ ├── IsNotFalse.java │ │ ├── IsNotTrue.java │ │ ├── IsTrue.java │ │ ├── Mappify.java │ │ ├── MathFunctions.java │ │ ├── Not.java │ │ ├── ParseQueryFunction.java │ │ ├── ParseUrlFunction.java │ │ ├── SimpleCastFunctions.java │ │ ├── SimpleRepeatedFunctions.java │ │ ├── StatisticsAggrFunctions.java │ │ ├── StringFunctions.java │ │ ├── TDigestFunctions.java │ │ ├── UnionFunctions.java │ │ └── conv │ │ ├── BigIntBEConvertFrom.java │ │ ├── BigIntBEConvertTo.java │ │ ├── BigIntConvertFrom.java │ │ ├── BigIntConvertTo.java │ │ ├── BigIntVLongConvertFrom.java │ │ ├── BigIntVLongConvertTo.java │ │ ├── BooleanByteConvertFrom.java │ │ ├── BooleanByteConvertTo.java │ │ ├── ConvertFromImpalaTimestamp.java │ │ ├── DateEpochBEConvertFrom.java │ │ ├── DateEpochBEConvertTo.java │ │ ├── DateEpochConvertFrom.java │ │ ├── DateEpochConvertTo.java │ │ ├── DoubleBEConvertFrom.java │ │ ├── DoubleBEConvertTo.java │ │ ├── DoubleConvertFrom.java │ │ ├── DoubleConvertTo.java │ │ ├── DummyConvertFrom.java │ │ ├── DummyConvertTo.java │ │ ├── DummyFlatten.java │ │ ├── FloatBEConvertFrom.java │ │ ├── FloatBEConvertTo.java │ │ ├── FloatConvertFrom.java │ │ ├── FloatConvertTo.java │ │ ├── IntBEConvertFrom.java │ │ ├── IntBEConvertTo.java │ │ ├── IntConvertFrom.java │ │ ├── IntConvertTo.java │ │ ├── IntVIntConvertFrom.java │ │ ├── IntVIntConvertTo.java │ │ ├── JsonConvertFrom.java │ │ ├── JsonConvertTo.java │ │ ├── RoundFunctions.java │ │ ├── SmallIntBEConvertFrom.java │ │ ├── SmallIntBEConvertTo.java │ │ ├── SmallIntConvertFrom.java │ │ ├── SmallIntConvertTo.java │ │ ├── TimeEpochBEConvertFrom.java │ │ ├── TimeEpochBEConvertTo.java │ │ ├── TimeEpochConvertFrom.java │ │ ├── TimeEpochConvertTo.java │ │ ├── TimeStampEpochBEConvertFrom.java │ │ ├── TimeStampEpochBEConvertTo.java │ │ ├── TimeStampEpochConvertFrom.java │ │ ├── TimeStampEpochConvertTo.java │ │ ├── TinyIntConvertFrom.java │ │ ├── TinyIntConvertTo.java │ │ ├── UInt4BEConvertFrom.java │ │ ├── UInt4BEConvertTo.java │ │ ├── UInt4ConvertFrom.java │ │ ├── UInt4ConvertTo.java │ │ ├── UInt8ConvertFrom.java │ │ ├── UInt8ConvertTo.java │ │ ├── UTF16ConvertFrom.java │ │ ├── UTF16ConvertTo.java │ │ ├── UTF8ConvertFrom.java │ │ └── UTF8ConvertTo.java │ └── resources │ └── drill-module.conf ├── hansql-logical ├── pom.xml └── src │ └── main │ ├── antlr4 │ └── org │ │ └── lealone │ │ └── hansql │ │ └── common │ │ └── expression │ │ └── parser │ │ ├── ExprLexer.g4 │ │ └── ExprParser.g4 │ └── java │ └── org │ └── lealone │ └── hansql │ └── common │ ├── JSONOptions.java │ ├── config │ └── LogicalPlanPersistence.java │ ├── exceptions │ ├── ExecutionSetupException.java │ ├── ExpressionParsingException.java │ ├── LogicalOperatorValidationException.java │ └── LogicalPlanParsingException.java │ ├── expression │ ├── AnyValueExpression.java │ ├── BooleanOperator.java │ ├── CastExpression.java │ ├── ConvertExpression.java │ ├── ErrorCollector.java │ ├── ErrorCollectorImpl.java │ ├── ExpressionFunction.java │ ├── ExpressionPosition.java │ ├── ExpressionStringBuilder.java │ ├── FieldReference.java │ ├── FunctionCall.java │ ├── FunctionCallFactory.java │ ├── FunctionHolderExpression.java │ ├── FunctionName.java │ ├── IfExpression.java │ ├── LogicalExpression.java │ ├── LogicalExpressionBase.java │ ├── MajorTypeInLogicalExpression.java │ ├── NullExpression.java │ ├── OutputTypeDeterminer.java │ ├── PathSegment.java │ ├── SchemaPath.java │ ├── TypedFieldExpr.java │ ├── TypedNullConstant.java │ ├── ValidationError.java │ ├── ValueExpressions.java │ ├── fn │ │ ├── FuncHolder.java │ │ ├── FunctionReplacementUtils.java │ │ ├── JodaDateValidator.java │ │ └── package-info.java │ ├── package-info.java │ ├── types │ │ ├── AtomType.java │ │ ├── DataType.java │ │ ├── DataTypeFactory.java │ │ ├── LateBindType.java │ │ └── package-info.java │ └── visitors │ │ ├── AbstractExprVisitor.java │ │ ├── AggregateChecker.java │ │ ├── ConditionalExprOptimizer.java │ │ ├── ConstantChecker.java │ │ ├── ExprVisitor.java │ │ ├── ExpressionValidationError.java │ │ ├── ExpressionValidationException.java │ │ ├── ExpressionValidator.java │ │ ├── OpVisitor.java │ │ ├── SimpleExprVisitor.java │ │ └── package-info.java │ ├── graph │ ├── AdjacencyList.java │ ├── AdjacencyListBuilder.java │ ├── Edge.java │ ├── Graph.java │ ├── GraphAlgos.java │ ├── GraphValue.java │ ├── GraphVisitor.java │ ├── Visitable.java │ └── package-info.java │ ├── logical │ ├── FormatPluginConfig.java │ ├── FormatPluginConfigBase.java │ ├── LogicalPlan.java │ ├── LogicalPlanBuilder.java │ ├── PlanProperties.java │ ├── StoragePluginConfig.java │ ├── StoragePluginConfigBase.java │ ├── UnexpectedOperatorType.java │ ├── ValidationError.java │ ├── data │ │ ├── AbstractBuilder.java │ │ ├── AbstractSingleBuilder.java │ │ ├── Analyze.java │ │ ├── Filter.java │ │ ├── Flatten.java │ │ ├── GroupingAggregate.java │ │ ├── Join.java │ │ ├── JoinCondition.java │ │ ├── LateralJoin.java │ │ ├── Limit.java │ │ ├── LogicalOperator.java │ │ ├── LogicalOperatorBase.java │ │ ├── LogicalSemiJoin.java │ │ ├── NamedExpression.java │ │ ├── Order.java │ │ ├── Project.java │ │ ├── RunningAggregate.java │ │ ├── Scan.java │ │ ├── SingleInputOperator.java │ │ ├── SinkOperator.java │ │ ├── SourceOperator.java │ │ ├── Store.java │ │ ├── Transform.java │ │ ├── Union.java │ │ ├── Unnest.java │ │ ├── Values.java │ │ ├── Window.java │ │ ├── Writer.java │ │ ├── package-info.java │ │ └── visitors │ │ │ ├── AbstractLogicalVisitor.java │ │ │ ├── LogicalVisitor.java │ │ │ └── package-info.java │ └── package-info.java │ ├── parser │ ├── ErrorListener.java │ └── LogicalExpressionParser.java │ └── util │ └── AbstractDynamicBean.java ├── hansql-optimizer ├── pom.xml └── src │ └── main │ ├── codegen │ ├── config.fmpp │ ├── includes │ │ ├── compoundIdentifier.ftl │ │ └── parserImpls.ftl │ └── templates │ │ └── Parser.jj │ ├── java │ └── org │ │ └── lealone │ │ └── hansql │ │ └── optimizer │ │ ├── config │ │ ├── BuiltInConnectionProperty.java │ │ ├── CalciteConnectionConfig.java │ │ ├── CalciteConnectionConfigImpl.java │ │ ├── CalciteConnectionProperty.java │ │ ├── CalciteSystemProperty.java │ │ ├── ConnectionConfig.java │ │ ├── ConnectionConfigImpl.java │ │ ├── ConnectionProperty.java │ │ ├── Lex.java │ │ ├── NullCollation.java │ │ └── package-info.java │ │ ├── plan │ │ ├── AbstractRelOptPlanner.java │ │ ├── CommonRelSubExprRule.java │ │ ├── Context.java │ │ ├── Contexts.java │ │ ├── Convention.java │ │ ├── ConventionTraitDef.java │ │ ├── MulticastRelOptListener.java │ │ ├── RelCompositeTrait.java │ │ ├── RelImplementor.java │ │ ├── RelMultipleTrait.java │ │ ├── RelOptAbstractTable.java │ │ ├── RelOptCluster.java │ │ ├── RelOptConnection.java │ │ ├── RelOptCost.java │ │ ├── RelOptCostFactory.java │ │ ├── RelOptCostImpl.java │ │ ├── RelOptListener.java │ │ ├── RelOptNode.java │ │ ├── RelOptPlanner.java │ │ ├── RelOptPredicateList.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 │ │ ├── RelTraitSet.java │ │ ├── RexImplicationChecker.java │ │ ├── Strong.java │ │ ├── TableAccessMap.java │ │ ├── ViewExpanders.java │ │ ├── VisitorDataContext.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 │ │ ├── rel │ │ ├── AbstractRelNode.java │ │ ├── BiRel.java │ │ ├── InvalidRelException.java │ │ ├── RelCollation.java │ │ ├── RelCollationImpl.java │ │ ├── RelCollationTraitDef.java │ │ ├── RelCollations.java │ │ ├── RelDistribution.java │ │ ├── RelDistributionTraitDef.java │ │ ├── RelDistributions.java │ │ ├── RelFieldCollation.java │ │ ├── RelHomogeneousShuttle.java │ │ ├── RelInput.java │ │ ├── RelNode.java │ │ ├── RelNodes.java │ │ ├── RelReferentialConstraint.java │ │ ├── RelReferentialConstraintImpl.java │ │ ├── RelRoot.java │ │ ├── RelShuttle.java │ │ ├── RelShuttleImpl.java │ │ ├── RelVisitor.java │ │ ├── RelWriter.java │ │ ├── SingleRel.java │ │ ├── convert │ │ │ ├── Converter.java │ │ │ ├── ConverterImpl.java │ │ │ ├── ConverterRule.java │ │ │ ├── NoneConverter.java │ │ │ ├── TraitMatchingRule.java │ │ │ └── package-info.java │ │ ├── core │ │ │ ├── Aggregate.java │ │ │ ├── AggregateCall.java │ │ │ ├── Calc.java │ │ │ ├── Collect.java │ │ │ ├── Correlate.java │ │ │ ├── CorrelationId.java │ │ │ ├── EquiJoin.java │ │ │ ├── Exchange.java │ │ │ ├── Filter.java │ │ │ ├── Intersect.java │ │ │ ├── Join.java │ │ │ ├── JoinInfo.java │ │ │ ├── JoinRelType.java │ │ │ ├── Match.java │ │ │ ├── Minus.java │ │ │ ├── Project.java │ │ │ ├── RelFactories.java │ │ │ ├── Sample.java │ │ │ ├── SemiJoin.java │ │ │ ├── SetOp.java │ │ │ ├── Snapshot.java │ │ │ ├── Sort.java │ │ │ ├── SortExchange.java │ │ │ ├── TableFunctionScan.java │ │ │ ├── TableModify.java │ │ │ ├── TableScan.java │ │ │ ├── Uncollect.java │ │ │ ├── Union.java │ │ │ ├── Values.java │ │ │ ├── Window.java │ │ │ └── package-info.java │ │ ├── enumerable │ │ │ ├── EnumerableConvention.java │ │ │ ├── EnumerableRel.java │ │ │ └── EnumerableTableScan.java │ │ ├── externalize │ │ │ ├── RelWriterImpl.java │ │ │ ├── RelXmlWriter.java │ │ │ └── package-info.java │ │ ├── logical │ │ │ ├── LogicalAggregate.java │ │ │ ├── LogicalCalc.java │ │ │ ├── LogicalCorrelate.java │ │ │ ├── LogicalExchange.java │ │ │ ├── LogicalFilter.java │ │ │ ├── LogicalIntersect.java │ │ │ ├── LogicalJoin.java │ │ │ ├── LogicalMatch.java │ │ │ ├── LogicalMinus.java │ │ │ ├── LogicalProject.java │ │ │ ├── LogicalSnapshot.java │ │ │ ├── LogicalSort.java │ │ │ ├── LogicalSortExchange.java │ │ │ ├── LogicalTableFunctionScan.java │ │ │ ├── LogicalTableModify.java │ │ │ ├── LogicalTableScan.java │ │ │ ├── LogicalUnion.java │ │ │ ├── LogicalValues.java │ │ │ ├── LogicalWindow.java │ │ │ └── package-info.java │ │ ├── metadata │ │ │ ├── BuiltInMetadata.java │ │ │ ├── CachingRelMetadataProvider.java │ │ │ ├── ChainedRelMetadataProvider.java │ │ │ ├── CyclicMetadataException.java │ │ │ ├── DefaultRelMetadataProvider.java │ │ │ ├── JaninoRelMetadataProvider.java │ │ │ ├── Metadata.java │ │ │ ├── MetadataDef.java │ │ │ ├── MetadataFactory.java │ │ │ ├── MetadataFactoryImpl.java │ │ │ ├── MetadataHandler.java │ │ │ ├── NullSentinel.java │ │ │ ├── ReflectiveRelMetadataProvider.java │ │ │ ├── RelColumnMapping.java │ │ │ ├── RelColumnOrigin.java │ │ │ ├── RelMdAllPredicates.java │ │ │ ├── RelMdCollation.java │ │ │ ├── RelMdColumnOrigins.java │ │ │ ├── RelMdColumnUniqueness.java │ │ │ ├── RelMdDistinctRowCount.java │ │ │ ├── RelMdDistribution.java │ │ │ ├── RelMdExplainVisibility.java │ │ │ ├── RelMdExpressionLineage.java │ │ │ ├── RelMdMaxRowCount.java │ │ │ ├── RelMdMemory.java │ │ │ ├── RelMdMinRowCount.java │ │ │ ├── RelMdNodeTypes.java │ │ │ ├── RelMdParallelism.java │ │ │ ├── RelMdPercentageOriginalRows.java │ │ │ ├── RelMdPopulationSize.java │ │ │ ├── RelMdPredicates.java │ │ │ ├── RelMdRowCount.java │ │ │ ├── RelMdSelectivity.java │ │ │ ├── RelMdSize.java │ │ │ ├── RelMdTableReferences.java │ │ │ ├── RelMdUniqueKeys.java │ │ │ ├── RelMdUtil.java │ │ │ ├── RelMetadataProvider.java │ │ │ ├── RelMetadataQuery.java │ │ │ ├── UnboundMetadata.java │ │ │ └── package-info.java │ │ ├── package-info.java │ │ ├── rel2sql │ │ │ ├── RelToSqlConverter.java │ │ │ ├── SqlImplementor.java │ │ │ └── package-info.java │ │ ├── rules │ │ │ ├── AbstractJoinExtractFilterRule.java │ │ │ ├── AggregateExpandDistinctAggregatesRule.java │ │ │ ├── AggregateExtractProjectRule.java │ │ │ ├── AggregateFilterTransposeRule.java │ │ │ ├── AggregateJoinTransposeRule.java │ │ │ ├── AggregateProjectMergeRule.java │ │ │ ├── AggregateProjectPullUpConstantsRule.java │ │ │ ├── AggregateReduceFunctionsRule.java │ │ │ ├── AggregateRemoveRule.java │ │ │ ├── AggregateUnionAggregateRule.java │ │ │ ├── AggregateUnionTransposeRule.java │ │ │ ├── AggregateValuesRule.java │ │ │ ├── CalcMergeRule.java │ │ │ ├── CalcRelSplitter.java │ │ │ ├── CalcRemoveRule.java │ │ │ ├── CalcSplitRule.java │ │ │ ├── CoerceInputsRule.java │ │ │ ├── DateRangeRules.java │ │ │ ├── EquiJoin.java │ │ │ ├── FilterAggregateTransposeRule.java │ │ │ ├── FilterCalcMergeRule.java │ │ │ ├── FilterCorrelateRule.java │ │ │ ├── FilterJoinRule.java │ │ │ ├── FilterMergeRule.java │ │ │ ├── FilterMultiJoinMergeRule.java │ │ │ ├── FilterProjectTransposeRule.java │ │ │ ├── FilterRemoveIsNotDistinctFromRule.java │ │ │ ├── FilterSetOpTransposeRule.java │ │ │ ├── FilterTableFunctionTransposeRule.java │ │ │ ├── FilterTableScanRule.java │ │ │ ├── FilterToCalcRule.java │ │ │ ├── IntersectToDistinctRule.java │ │ │ ├── JoinAddRedundantSemiJoinRule.java │ │ │ ├── JoinAssociateRule.java │ │ │ ├── JoinCommuteRule.java │ │ │ ├── JoinExtractFilterRule.java │ │ │ ├── JoinProjectTransposeRule.java │ │ │ ├── JoinPushExpressionsRule.java │ │ │ ├── JoinPushThroughJoinRule.java │ │ │ ├── JoinPushTransitivePredicatesRule.java │ │ │ ├── JoinToCorrelateRule.java │ │ │ ├── JoinToMultiJoinRule.java │ │ │ ├── JoinUnionTransposeRule.java │ │ │ ├── LoptJoinTree.java │ │ │ ├── LoptMultiJoin.java │ │ │ ├── LoptOptimizeJoinRule.java │ │ │ ├── LoptSemiJoinOptimizer.java │ │ │ ├── MultiJoin.java │ │ │ ├── MultiJoinOptimizeBushyRule.java │ │ │ ├── MultiJoinProjectTransposeRule.java │ │ │ ├── ProjectCalcMergeRule.java │ │ │ ├── ProjectCorrelateTransposeRule.java │ │ │ ├── ProjectFilterTransposeRule.java │ │ │ ├── ProjectJoinTransposeRule.java │ │ │ ├── ProjectMergeRule.java │ │ │ ├── ProjectMultiJoinMergeRule.java │ │ │ ├── ProjectRemoveRule.java │ │ │ ├── ProjectSetOpTransposeRule.java │ │ │ ├── ProjectSortTransposeRule.java │ │ │ ├── ProjectToCalcRule.java │ │ │ ├── ProjectToWindowRule.java │ │ │ ├── ProjectWindowTransposeRule.java │ │ │ ├── PruneEmptyRules.java │ │ │ ├── PushProjector.java │ │ │ ├── ReduceDecimalsRule.java │ │ │ ├── ReduceExpressionsRule.java │ │ │ ├── SemiJoinFilterTransposeRule.java │ │ │ ├── SemiJoinJoinTransposeRule.java │ │ │ ├── SemiJoinProjectTransposeRule.java │ │ │ ├── SemiJoinRemoveRule.java │ │ │ ├── SemiJoinRule.java │ │ │ ├── SortJoinTransposeRule.java │ │ │ ├── SortProjectTransposeRule.java │ │ │ ├── SortRemoveConstantKeysRule.java │ │ │ ├── SortRemoveRule.java │ │ │ ├── SortUnionTransposeRule.java │ │ │ ├── SubQueryRemoveRule.java │ │ │ ├── TableScanRule.java │ │ │ ├── UnionEliminatorRule.java │ │ │ ├── UnionMergeRule.java │ │ │ ├── UnionPullUpConstantsRule.java │ │ │ ├── UnionToDistinctRule.java │ │ │ ├── ValuesReduceRule.java │ │ │ └── package-info.java │ │ └── type │ │ │ ├── DelegatingTypeSystem.java │ │ │ ├── DynamicRecordType.java │ │ │ ├── DynamicRecordTypeImpl.java │ │ │ ├── RelCrossType.java │ │ │ ├── RelDataType.java │ │ │ ├── RelDataTypeComparability.java │ │ │ ├── RelDataTypeFactory.java │ │ │ ├── RelDataTypeFactoryImpl.java │ │ │ ├── RelDataTypeFamily.java │ │ │ ├── RelDataTypeField.java │ │ │ ├── RelDataTypeFieldImpl.java │ │ │ ├── RelDataTypeHolder.java │ │ │ ├── RelDataTypeImpl.java │ │ │ ├── RelDataTypePrecedenceList.java │ │ │ ├── RelDataTypeSystem.java │ │ │ ├── RelDataTypeSystemImpl.java │ │ │ ├── RelProtoDataType.java │ │ │ ├── RelRecordType.java │ │ │ ├── StructKind.java │ │ │ ├── annotations │ │ │ ├── Array.java │ │ │ └── Map.java │ │ │ ├── java │ │ │ ├── JavaRecordType.java │ │ │ ├── JavaTypeFactory.java │ │ │ ├── JavaTypeFactoryImpl.java │ │ │ ├── Primitive.java │ │ │ ├── PseudoField.java │ │ │ └── Types.java │ │ │ └── package-info.java │ │ ├── rex │ │ ├── LogicVisitor.java │ │ ├── RexAction.java │ │ ├── RexAnalyzer.java │ │ ├── RexBiVisitor.java │ │ ├── RexBuilder.java │ │ ├── RexCall.java │ │ ├── RexCallBinding.java │ │ ├── RexChecker.java │ │ ├── RexCopier.java │ │ ├── RexCorrelVariable.java │ │ ├── RexDigestIncludeType.java │ │ ├── RexDynamicParam.java │ │ ├── RexExecutable.java │ │ ├── RexExecutor.java │ │ ├── RexExecutorImpl.java │ │ ├── RexFactory.java │ │ ├── RexFieldAccess.java │ │ ├── RexFieldCollation.java │ │ ├── RexInputRef.java │ │ ├── RexInterpreter.java │ │ ├── RexLiteral.java │ │ ├── RexLocalRef.java │ │ ├── RexMultisetUtil.java │ │ ├── RexNode.java │ │ ├── RexOver.java │ │ ├── RexPattern.java │ │ ├── RexPatternFieldRef.java │ │ ├── RexPermutationShuttle.java │ │ ├── RexPermuteInputsShuttle.java │ │ ├── RexProgram.java │ │ ├── RexProgramBuilder.java │ │ ├── RexRangeRef.java │ │ ├── RexShuttle.java │ │ ├── RexSimplify.java │ │ ├── RexSlot.java │ │ ├── RexSqlConvertlet.java │ │ ├── RexSqlConvertletTable.java │ │ ├── RexSqlReflectiveConvertletTable.java │ │ ├── RexSqlStandardConvertletTable.java │ │ ├── RexSubQuery.java │ │ ├── RexTableInputRef.java │ │ ├── RexToSqlNodeConverter.java │ │ ├── RexToSqlNodeConverterImpl.java │ │ ├── RexTransformer.java │ │ ├── RexUnknownAs.java │ │ ├── RexUtil.java │ │ ├── RexVariable.java │ │ ├── RexVisitor.java │ │ ├── RexVisitorImpl.java │ │ ├── RexWindow.java │ │ ├── RexWindowBound.java │ │ ├── impl │ │ │ ├── RexCallImpl.java │ │ │ ├── RexCorrelVariableImpl.java │ │ │ ├── RexDynamicParamImpl.java │ │ │ ├── RexFactoryImpl.java │ │ │ ├── RexFieldAccessImpl.java │ │ │ ├── RexInputRefImpl.java │ │ │ ├── RexLiteralImpl.java │ │ │ ├── RexLocalRefImpl.java │ │ │ ├── RexMRAggCallImpl.java │ │ │ ├── RexNodeBase.java │ │ │ ├── RexOverImpl.java │ │ │ ├── RexRangeRefImpl.java │ │ │ ├── RexSlotBase.java │ │ │ ├── RexSubQueryImpl.java │ │ │ ├── RexVariableBase.java │ │ │ └── RexWinAggCallImpl.java │ │ └── package-info.java │ │ ├── schema │ │ ├── AggregateFunction.java │ │ ├── CachingCalciteSchema.java │ │ ├── CalciteCatalogReader.java │ │ ├── CalciteSchema.java │ │ ├── CatalogReader.java │ │ ├── ColumnStrategy.java │ │ ├── CustomColumnResolvingTable.java │ │ ├── ExtensibleTable.java │ │ ├── FilterableTable.java │ │ ├── Function.java │ │ ├── FunctionParameter.java │ │ ├── ModifiableTable.java │ │ ├── ModifiableView.java │ │ ├── Path.java │ │ ├── PreparingTable.java │ │ ├── QueryableTable.java │ │ ├── RelOptTableImpl.java │ │ ├── ScalarFunction.java │ │ ├── ScannableTable.java │ │ ├── Schema.java │ │ ├── SchemaFactory.java │ │ ├── SchemaPlus.java │ │ ├── SchemaVersion.java │ │ ├── Schemas.java │ │ ├── SimpleCalciteSchema.java │ │ ├── Statistic.java │ │ ├── Statistics.java │ │ ├── Table.java │ │ ├── TableFactory.java │ │ ├── TableFunction.java │ │ ├── TableMacro.java │ │ ├── TemporalTable.java │ │ ├── TranslatableTable.java │ │ ├── Wrapper.java │ │ ├── impl │ │ │ ├── AbstractQueryableTable.java │ │ │ ├── AbstractSchema.java │ │ │ ├── AbstractTable.java │ │ │ ├── CalciteResult.java │ │ │ ├── DelegatingSchema.java │ │ │ ├── LongSchemaVersion.java │ │ │ ├── ModifiableViewTable.java │ │ │ ├── ReflectiveFunctionBase.java │ │ │ ├── ScalarFunctionImpl.java │ │ │ ├── TableMacroImpl.java │ │ │ ├── ViewTable.java │ │ │ ├── ViewTableMacro.java │ │ │ └── package-info.java │ │ └── package-info.java │ │ ├── sql │ │ ├── ExplicitOperatorBinding.java │ │ ├── JoinConditionType.java │ │ ├── JoinType.java │ │ ├── SemiJoinType.java │ │ ├── SqlAbstractDateTimeLiteral.java │ │ ├── SqlAbstractStringLiteral.java │ │ ├── SqlAccessEnum.java │ │ ├── SqlAccessType.java │ │ ├── SqlAggFunction.java │ │ ├── SqlAlter.java │ │ ├── SqlAsOperator.java │ │ ├── SqlBasicCall.java │ │ ├── SqlBinaryOperator.java │ │ ├── SqlBinaryStringLiteral.java │ │ ├── SqlCall.java │ │ ├── SqlCallBinding.java │ │ ├── SqlCharStringLiteral.java │ │ ├── SqlCollation.java │ │ ├── SqlCreate.java │ │ ├── SqlDataTypeSpec.java │ │ ├── SqlDateLiteral.java │ │ ├── SqlDdl.java │ │ ├── SqlDelete.java │ │ ├── SqlDescribeSchema.java │ │ ├── SqlDescribeTable.java │ │ ├── SqlDialect.java │ │ ├── SqlDialectFactory.java │ │ ├── SqlDialectFactoryImpl.java │ │ ├── SqlDrop.java │ │ ├── SqlDynamicParam.java │ │ ├── SqlExplain.java │ │ ├── SqlExplainFormat.java │ │ ├── SqlExplainLevel.java │ │ ├── SqlFilterOperator.java │ │ ├── SqlFunction.java │ │ ├── SqlFunctionCategory.java │ │ ├── SqlFunctionalOperator.java │ │ ├── SqlGroupedWindowFunction.java │ │ ├── SqlIdentifier.java │ │ ├── SqlInfixOperator.java │ │ ├── SqlInsert.java │ │ ├── SqlInsertKeyword.java │ │ ├── SqlInternalOperator.java │ │ ├── SqlIntervalLiteral.java │ │ ├── SqlIntervalQualifier.java │ │ ├── SqlJdbcDataTypeName.java │ │ ├── SqlJdbcFunctionCall.java │ │ ├── SqlJoin.java │ │ ├── SqlJsonConstructorNullClause.java │ │ ├── SqlJsonEmptyOrError.java │ │ ├── SqlJsonEncoding.java │ │ ├── SqlJsonExistsErrorBehavior.java │ │ ├── SqlJsonQueryEmptyOrErrorBehavior.java │ │ ├── SqlJsonQueryWrapperBehavior.java │ │ ├── SqlJsonValueEmptyOrErrorBehavior.java │ │ ├── SqlKind.java │ │ ├── SqlLateralOperator.java │ │ ├── SqlLiteral.java │ │ ├── SqlMatchRecognize.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 │ │ ├── SqlSnapshot.java │ │ ├── SqlSpecialOperator.java │ │ ├── SqlSplittableAggFunction.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 │ │ ├── SqlWithinGroupOperator.java │ │ ├── SqlWriter.java │ │ ├── dialect │ │ │ ├── AccessSqlDialect.java │ │ │ ├── AnsiSqlDialect.java │ │ │ ├── BigQuerySqlDialect.java │ │ │ ├── CalciteSqlDialect.java │ │ │ ├── Db2SqlDialect.java │ │ │ ├── DerbySqlDialect.java │ │ │ ├── FirebirdSqlDialect.java │ │ │ ├── H2SqlDialect.java │ │ │ ├── HiveSqlDialect.java │ │ │ ├── HsqldbSqlDialect.java │ │ │ ├── InfobrightSqlDialect.java │ │ │ ├── InformixSqlDialect.java │ │ │ ├── IngresSqlDialect.java │ │ │ ├── InterbaseSqlDialect.java │ │ │ ├── JethroDataSqlDialect.java │ │ │ ├── LucidDbSqlDialect.java │ │ │ ├── MssqlSqlDialect.java │ │ │ ├── MysqlSqlDialect.java │ │ │ ├── NeoviewSqlDialect.java │ │ │ ├── NetezzaSqlDialect.java │ │ │ ├── OracleSqlDialect.java │ │ │ ├── ParaccelSqlDialect.java │ │ │ ├── PhoenixSqlDialect.java │ │ │ ├── PostgresqlSqlDialect.java │ │ │ ├── RedshiftSqlDialect.java │ │ │ ├── SparkSqlDialect.java │ │ │ ├── SybaseSqlDialect.java │ │ │ ├── TeradataSqlDialect.java │ │ │ ├── VerticaSqlDialect.java │ │ │ └── package-info.java │ │ ├── fun │ │ │ ├── OracleSqlOperatorTable.java │ │ │ ├── SqlAbstractGroupFunction.java │ │ │ ├── SqlAbstractTimeFunction.java │ │ │ ├── SqlAnyValueAggFunction.java │ │ │ ├── SqlArgumentAssignmentOperator.java │ │ │ ├── SqlArrayQueryConstructor.java │ │ │ ├── SqlArrayValueConstructor.java │ │ │ ├── SqlAvgAggFunction.java │ │ │ ├── SqlBaseContextVariable.java │ │ │ ├── SqlBetweenOperator.java │ │ │ ├── SqlBitOpAggFunction.java │ │ │ ├── SqlCase.java │ │ │ ├── SqlCaseOperator.java │ │ │ ├── SqlCastFunction.java │ │ │ ├── SqlCoalesceFunction.java │ │ │ ├── SqlCollectionTableOperator.java │ │ │ ├── SqlColumnListConstructor.java │ │ │ ├── SqlConvertFunction.java │ │ │ ├── SqlCountAggFunction.java │ │ │ ├── SqlCovarAggFunction.java │ │ │ ├── SqlCurrentDateFunction.java │ │ │ ├── SqlCursorConstructor.java │ │ │ ├── SqlDatePartFunction.java │ │ │ ├── SqlDatetimePlusOperator.java │ │ │ ├── SqlDatetimeSubtractionOperator.java │ │ │ ├── SqlDefaultOperator.java │ │ │ ├── SqlDotOperator.java │ │ │ ├── SqlExtendOperator.java │ │ │ ├── SqlExtractFunction.java │ │ │ ├── SqlFirstLastValueAggFunction.java │ │ │ ├── SqlFloorFunction.java │ │ │ ├── SqlGroupIdFunction.java │ │ │ ├── SqlGroupingFunction.java │ │ │ ├── SqlGroupingIdFunction.java │ │ │ ├── SqlHistogramAggFunction.java │ │ │ ├── SqlInOperator.java │ │ │ ├── SqlItemOperator.java │ │ │ ├── SqlJsonApiCommonSyntaxOperator.java │ │ │ ├── SqlJsonArrayAggAggFunction.java │ │ │ ├── SqlJsonArrayFunction.java │ │ │ ├── SqlJsonDepthFunction.java │ │ │ ├── SqlJsonExistsFunction.java │ │ │ ├── SqlJsonObjectAggAggFunction.java │ │ │ ├── SqlJsonObjectFunction.java │ │ │ ├── SqlJsonPrettyFunction.java │ │ │ ├── SqlJsonQueryFunction.java │ │ │ ├── SqlJsonTypeFunction.java │ │ │ ├── SqlJsonValueExpressionOperator.java │ │ │ ├── SqlJsonValueFunction.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 │ │ │ ├── SqlNthValueAggFunction.java │ │ │ ├── SqlNtileAggFunction.java │ │ │ ├── SqlNullifFunction.java │ │ │ ├── SqlOverlapsOperator.java │ │ │ ├── SqlOverlayFunction.java │ │ │ ├── SqlPositionFunction.java │ │ │ ├── SqlQuantifyOperator.java │ │ │ ├── SqlRandFunction.java │ │ │ ├── SqlRandIntegerFunction.java │ │ │ ├── SqlRegrCountAggFunction.java │ │ │ ├── SqlRollupOperator.java │ │ │ ├── SqlRowOperator.java │ │ │ ├── SqlSequenceValueOperator.java │ │ │ ├── SqlSingleValueAggFunction.java │ │ │ ├── SqlStdOperatorTable.java │ │ │ ├── SqlStringContextVariable.java │ │ │ ├── SqlSubstringFunction.java │ │ │ ├── SqlSumAggFunction.java │ │ │ ├── SqlSumEmptyIsZeroAggFunction.java │ │ │ ├── SqlThrowOperator.java │ │ │ ├── SqlTimestampAddFunction.java │ │ │ ├── SqlTimestampDiffFunction.java │ │ │ ├── SqlTranslate3Function.java │ │ │ ├── SqlTrimFunction.java │ │ │ └── package-info.java │ │ ├── package-info.java │ │ ├── parser │ │ │ ├── Span.java │ │ │ ├── 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 │ │ │ ├── CompositeSingleOperandTypeChecker.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 │ │ │ ├── SameOperandTypeExceptLastOperandChecker.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 │ │ │ ├── DataContext.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 │ │ │ ├── AggVisitor.java │ │ │ ├── AggregatingScope.java │ │ │ ├── AggregatingSelectScope.java │ │ │ ├── AliasNamespace.java │ │ │ ├── CatalogScope.java │ │ │ ├── CollectNamespace.java │ │ │ ├── CollectScope.java │ │ │ ├── CyclicDefinitionException.java │ │ │ ├── DelegatingNamespace.java │ │ │ ├── DelegatingScope.java │ │ │ ├── DelegatingSqlValidatorCatalogReader.java │ │ │ ├── DelegatingSqlValidatorTable.java │ │ │ ├── EmptyScope.java │ │ │ ├── FieldNamespace.java │ │ │ ├── GroupByScope.java │ │ │ ├── IdentifierNamespace.java │ │ │ ├── JoinNamespace.java │ │ │ ├── JoinScope.java │ │ │ ├── ListScope.java │ │ │ ├── MatchRecognizeNamespace.java │ │ │ ├── MatchRecognizeScope.java │ │ │ ├── OrderByScope.java │ │ │ ├── OverScope.java │ │ │ ├── ParameterNamespace.java │ │ │ ├── ParameterScope.java │ │ │ ├── ProcedureNamespace.java │ │ │ ├── SchemaNamespace.java │ │ │ ├── ScopeChild.java │ │ │ ├── SelectNamespace.java │ │ │ ├── SelectScope.java │ │ │ ├── SetopNamespace.java │ │ │ ├── SqlAbstractConformance.java │ │ │ ├── SqlConformance.java │ │ │ ├── SqlConformanceEnum.java │ │ │ ├── SqlDelegatingConformance.java │ │ │ ├── SqlIdentifierMoniker.java │ │ │ ├── SqlModality.java │ │ │ ├── SqlMoniker.java │ │ │ ├── SqlMonikerImpl.java │ │ │ ├── SqlMonikerType.java │ │ │ ├── SqlMonotonicity.java │ │ │ ├── SqlNameMatcher.java │ │ │ ├── SqlNameMatchers.java │ │ │ ├── SqlQualified.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 │ │ │ ├── TableScope.java │ │ │ ├── UnnestNamespace.java │ │ │ ├── WithItemNamespace.java │ │ │ ├── WithNamespace.java │ │ │ ├── WithScope.java │ │ │ └── package-info.java │ │ ├── sql2rel │ │ ├── AuxiliaryConverter.java │ │ ├── CorrelationReferenceFinder.java │ │ ├── DeduplicateCorrelateVariables.java │ │ ├── InitializerContext.java │ │ ├── InitializerExpressionFactory.java │ │ ├── NullInitializerExpressionFactory.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 │ │ ├── tools │ │ ├── Program.java │ │ ├── Programs.java │ │ ├── RelBuilder.java │ │ ├── RelBuilderFactory.java │ │ ├── RelConversionException.java │ │ ├── RuleSet.java │ │ ├── RuleSets.java │ │ ├── ValidationException.java │ │ └── package-info.java │ │ └── util │ │ ├── AbstractImmutableList.java │ │ ├── BarfingInvocationHandler.java │ │ ├── Benchmark.java │ │ ├── BitSets.java │ │ ├── BitString.java │ │ ├── Bug.java │ │ ├── BuiltInMethod.java │ │ ├── ByteString.java │ │ ├── CalciteContextException.java │ │ ├── CalciteException.java │ │ ├── CalciteParserException.java │ │ ├── CalciteResource.java │ │ ├── CalciteValidatorException.java │ │ ├── CancelFlag.java │ │ ├── CartesianProductEnumerator.java │ │ ├── CaseInsensitiveComparator.java │ │ ├── Casing.java │ │ ├── CastingList.java │ │ ├── ChunkList.java │ │ ├── Closer.java │ │ ├── CompositeList.java │ │ ├── CompositeMap.java │ │ ├── ConsList.java │ │ ├── ControlFlowException.java │ │ ├── ConversionUtil.java │ │ ├── DateString.java │ │ ├── DateTimeStringUtils.java │ │ ├── DateTimeUtils.java │ │ ├── DelegatingInvocationHandler.java │ │ ├── Enumerable.java │ │ ├── Enumerator.java │ │ ├── EnumeratorUtils.java │ │ ├── EquivalenceSet.java │ │ ├── Feature.java │ │ ├── Filterator.java │ │ ├── FlatLists.java │ │ ├── FluentListUtils.java │ │ ├── GeoFunctions.java │ │ ├── Glossary.java │ │ ├── Holder.java │ │ ├── Hook.java │ │ ├── ImmutableBitSet.java │ │ ├── ImmutableIntList.java │ │ ├── ImmutableNullableList.java │ │ ├── IntList.java │ │ ├── IntegerIntervalSet.java │ │ ├── Litmus.java │ │ ├── NameMap.java │ │ ├── NameMultimap.java │ │ ├── NameSet.java │ │ ├── NlsString.java │ │ ├── NumberUtil.java │ │ ├── Optionality.java │ │ ├── Ord.java │ │ ├── PackageMarker.java │ │ ├── Pair.java │ │ ├── PartiallyOrderedSet.java │ │ ├── Permutation.java │ │ ├── PluginUtils.java │ │ ├── PrecedenceClimbingParser.java │ │ ├── Quoting.java │ │ ├── ReflectUtil.java │ │ ├── ReflectiveVisitDispatcher.java │ │ ├── ReflectiveVisitor.java │ │ ├── Resources.java │ │ ├── Row.java │ │ ├── SaffronProperties.java │ │ ├── SerializableCharset.java │ │ ├── Source.java │ │ ├── SourceStringReader.java │ │ ├── Sources.java │ │ ├── Spacer.java │ │ ├── Spaces.java │ │ ├── SqlFunctions.java │ │ ├── StackWriter.java │ │ ├── Stacks.java │ │ ├── Static.java │ │ ├── Template.java │ │ ├── TimeString.java │ │ ├── TimeUnit.java │ │ ├── TimeUnitRange.java │ │ ├── TimeWithTimeZoneString.java │ │ ├── TimestampString.java │ │ ├── TimestampWithTimeZoneString.java │ │ ├── TryThreadLocal.java │ │ ├── Unit.java │ │ ├── UnmodifiableArrayList.java │ │ ├── Unsafe.java │ │ ├── Util.java │ │ ├── Utilities.java │ │ ├── XmlOutput.java │ │ ├── annotations │ │ ├── Experimental.java │ │ └── NonDeterministic.java │ │ ├── function │ │ ├── Function.java │ │ ├── Function0.java │ │ ├── Function1.java │ │ ├── Function2.java │ │ ├── Functions.java │ │ └── Parameter.java │ │ ├── graph │ │ ├── AttributedDirectedGraph.java │ │ ├── BreadthFirstIterator.java │ │ ├── CycleDetector.java │ │ ├── DefaultDirectedGraph.java │ │ ├── DefaultEdge.java │ │ ├── DepthFirstIterator.java │ │ ├── DirectedGraph.java │ │ ├── Graphs.java │ │ ├── TopologicalOrderIterator.java │ │ └── package-info.java │ │ ├── javac │ │ ├── JaninoCompiler.java │ │ ├── JavaCompiler.java │ │ ├── JavaCompilerArgs.java │ │ └── package-info.java │ │ ├── mapping │ │ ├── AbstractSourceMapping.java │ │ ├── AbstractTargetMapping.java │ │ ├── IntPair.java │ │ ├── Mapping.java │ │ ├── MappingType.java │ │ ├── Mappings.java │ │ └── package-info.java │ │ ├── package-info.java │ │ └── trace │ │ ├── CalciteLogger.java │ │ ├── CalciteTimingTracer.java │ │ ├── CalciteTrace.java │ │ └── package-info.java │ └── resources │ └── org │ └── lealone │ └── hansql │ └── optimizer │ └── util │ └── CalciteResource.properties ├── hansql-test ├── pom.xml └── src │ └── test │ ├── java │ └── org │ │ └── lealone │ │ └── hansql │ │ └── test │ │ ├── DeleteTestData.java │ │ ├── HanEngineStart.java │ │ ├── engine │ │ └── HanEngineTest.java │ │ ├── executor │ │ └── DrillFuncTest.java │ │ ├── jdbc │ │ └── JdbcTest.java │ │ ├── optimizer │ │ └── HanSQLOptimizerTest.java │ │ └── util │ │ ├── StoragePluginTestUtils.java │ │ └── TestMemoryRetention.java │ └── resources │ ├── lealone-test.yaml │ ├── log4j2-test.xml │ ├── logback-test.xml │ └── test.csvh ├── hansql-vector ├── pom.xml └── src │ └── main │ ├── codegen │ ├── config.fmpp │ ├── data │ │ └── ValueVectorTypes.tdd │ ├── includes │ │ ├── license.ftl │ │ └── vv_imports.ftl │ └── templates │ │ ├── AbstractFieldReader.java │ │ ├── AbstractFieldWriter.java │ │ ├── AbstractPromotableFieldWriter.java │ │ ├── BaseReader.java │ │ ├── BaseWriter.java │ │ ├── BasicTypeHelper.java │ │ ├── ColumnAccessors.java │ │ ├── ComplexCopier.java │ │ ├── ComplexReaders.java │ │ ├── ComplexWriters.java │ │ ├── FixedValueVectors.java │ │ ├── HolderReaderImpl.java │ │ ├── ListWriters.java │ │ ├── MapWriters.java │ │ ├── NullReader.java │ │ ├── NullableValueVectors.java │ │ ├── RepeatedValueVectors.java │ │ ├── UnionListWriter.java │ │ ├── UnionReader.java │ │ ├── UnionVector.java │ │ ├── UnionWriter.java │ │ ├── ValueHolders.java │ │ └── VariableLengthVectors.java │ └── java │ └── org │ └── lealone │ └── hansql │ └── exec │ ├── exception │ ├── OversizedAllocationException.java │ └── SchemaChangeRuntimeException.java │ ├── expr │ ├── fn │ │ └── impl │ │ │ ├── ByteFunctionHelpers.java │ │ │ └── DateUtility.java │ └── holders │ │ ├── ComplexHolder.java │ │ ├── ListHolder.java │ │ ├── MapHolder.java │ │ ├── ObjectHolder.java │ │ ├── RepeatedListHolder.java │ │ ├── RepeatedMapHolder.java │ │ ├── UnionHolder.java │ │ └── ValueHolder.java │ ├── record │ ├── MaterializedField.java │ ├── TransferPair.java │ └── metadata │ │ ├── AbstractPropertied.java │ │ ├── ColumnMetadata.java │ │ ├── ProjectionType.java │ │ ├── Propertied.java │ │ ├── PropertyAccessor.java │ │ ├── TupleMetadata.java │ │ ├── TupleNameSpace.java │ │ └── VariantMetadata.java │ ├── util │ ├── CallBack.java │ ├── DecimalUtility.java │ ├── JsonStringArrayList.java │ ├── JsonStringHashMap.java │ ├── SerializationModule.java │ └── Text.java │ └── vector │ ├── AddOrGetResult.java │ ├── AllocationHelper.java │ ├── BaseDataValueVector.java │ ├── BaseValueVector.java │ ├── BitVector.java │ ├── DateUtilities.java │ ├── FixedWidthVector.java │ ├── NullableVector.java │ ├── NullableVectorDefinitionSetter.java │ ├── ObjectVector.java │ ├── SchemaChangeCallBack.java │ ├── UntypedHolderReaderImpl.java │ ├── UntypedNullHolder.java │ ├── UntypedNullVector.java │ ├── UntypedReader.java │ ├── UntypedReaderImpl.java │ ├── ValueHolderHelper.java │ ├── ValueVector.java │ ├── VarLenBulkEntry.java │ ├── VarLenBulkInput.java │ ├── VariableWidthVector.java │ ├── VectorDescriptor.java │ ├── VectorOverflowException.java │ ├── VectorTrimmer.java │ ├── ZeroVector.java │ ├── accessor │ ├── Accessors.md │ ├── ArrayReader.java │ ├── ArrayWriter.java │ ├── ColumnReader.java │ ├── ColumnReaderIndex.java │ ├── ColumnWriter.java │ ├── ColumnWriterIndex.java │ ├── Components.md │ ├── Futures.md │ ├── InvalidConversionError.java │ ├── Metadata.md │ ├── ObjectReader.java │ ├── ObjectType.java │ ├── ObjectWriter.java │ ├── Overview.md │ ├── README.md │ ├── Readers.md │ ├── RowSet.md │ ├── ScalarReader.java │ ├── ScalarWriter.java │ ├── TupleReader.java │ ├── TupleWriter.java │ ├── UnsupportedConversionError.java │ ├── ValueType.java │ ├── VariantReader.java │ ├── VariantWriter.java │ ├── WriterPosition.java │ ├── Writers.md │ ├── convert │ │ ├── AbstractConvertFromString.java │ │ ├── AbstractWriteConverter.java │ │ ├── ColumnConversionFactory.java │ │ ├── ConvertBooleanToString.java │ │ ├── ConvertDateToString.java │ │ ├── ConvertDecimalToString.java │ │ ├── ConvertDoubleToString.java │ │ ├── ConvertIntToString.java │ │ ├── ConvertIntervalToString.java │ │ ├── ConvertLongToString.java │ │ ├── ConvertStringToBoolean.java │ │ ├── ConvertStringToDate.java │ │ ├── ConvertStringToDecimal.java │ │ ├── ConvertStringToDouble.java │ │ ├── ConvertStringToInt.java │ │ ├── ConvertStringToInterval.java │ │ ├── ConvertStringToLong.java │ │ ├── ConvertStringToTime.java │ │ ├── ConvertStringToTimeStamp.java │ │ ├── ConvertTimeStampToString.java │ │ ├── ConvertTimeToString.java │ │ ├── StandardConversions.java │ │ └── package-info.java │ ├── impl │ │ ├── AccessorUtilities.java │ │ ├── HierarchicalFormatter.java │ │ ├── HierarchicalPrinter.java │ │ ├── VectorPrinter.java │ │ └── package-info.java │ ├── package-info.java │ ├── reader │ │ ├── AbstractObjectReader.java │ │ ├── AbstractScalarReader.java │ │ ├── AbstractTupleReader.java │ │ ├── ArrayReaderImpl.java │ │ ├── BaseScalarReader.java │ │ ├── BitColumnReader.java │ │ ├── ColumnReaderFactory.java │ │ ├── ElementReaderIndex.java │ │ ├── MapReader.java │ │ ├── NullStateReader.java │ │ ├── NullStateReaders.java │ │ ├── OffsetVectorReader.java │ │ ├── ReaderEvents.java │ │ ├── UnionReaderImpl.java │ │ ├── VectorAccessor.java │ │ ├── VectorAccessors.java │ │ └── package-info.java │ └── writer │ │ ├── AbstractArrayWriter.java │ │ ├── AbstractFixedWidthWriter.java │ │ ├── AbstractObjectWriter.java │ │ ├── AbstractScalarWriter.java │ │ ├── AbstractScalarWriterImpl.java │ │ ├── AbstractTupleWriter.java │ │ ├── BaseScalarWriter.java │ │ ├── BaseVarWidthWriter.java │ │ ├── BitColumnWriter.java │ │ ├── ColumnWriterFactory.java │ │ ├── EmptyListShim.java │ │ ├── ListWriterImpl.java │ │ ├── MapWriter.java │ │ ├── NullableScalarWriter.java │ │ ├── ObjectArrayWriter.java │ │ ├── OffsetVectorWriter.java │ │ ├── OffsetVectorWriterImpl.java │ │ ├── RepeatedListWriter.java │ │ ├── ScalarArrayWriter.java │ │ ├── SimpleListShim.java │ │ ├── UnionVectorShim.java │ │ ├── UnionWriterImpl.java │ │ ├── WriterEvents.java │ │ ├── dummy │ │ ├── DummyArrayWriter.java │ │ ├── DummyScalarWriter.java │ │ └── package-info.java │ │ └── package-info.java │ └── complex │ ├── AbstractContainerVector.java │ ├── AbstractMapVector.java │ ├── BaseRepeatedValueVector.java │ ├── ContainerVectorLike.java │ ├── EmptyValuePopulator.java │ ├── ListVector.java │ ├── MapVector.java │ ├── Positionable.java │ ├── RepeatedFixedWidthVectorLike.java │ ├── RepeatedListVector.java │ ├── RepeatedMapVector.java │ ├── RepeatedValueVector.java │ ├── RepeatedVariableWidthVectorLike.java │ ├── StateTool.java │ ├── VectorWithOrdinal.java │ ├── impl │ ├── AbstractBaseReader.java │ ├── AbstractBaseWriter.java │ ├── ComplexWriterImpl.java │ ├── MapOrListWriterImpl.java │ ├── PromotableWriter.java │ ├── RepeatedListReaderImpl.java │ ├── RepeatedMapReaderImpl.java │ ├── SingleLikeRepeatedMapReaderImpl.java │ ├── SingleListReaderImpl.java │ ├── SingleMapReaderImpl.java │ └── UnionListReader.java │ ├── reader │ └── FieldReader.java │ └── writer │ └── FieldWriter.java └── pom.xml /.gitignore: -------------------------------------------------------------------------------- 1 | *.class 2 | *.jar 3 | 4 | .settings 5 | .classpath 6 | .project 7 | target 8 | .idea 9 | -------------------------------------------------------------------------------- /hansql-common/src/main/java/org/lealone/hansql/common/config/ConfigFileInfo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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.lealone.hansql.common.config; 19 | 20 | /** 21 | * Interface that defines implementation to get all the config files names for default, module specific, distribution 22 | * specific and override files. 23 | */ 24 | public interface ConfigFileInfo { 25 | 26 | String getDefaultFileName(); 27 | 28 | String getModuleFileName(); 29 | 30 | String getDistributionFileName(); 31 | 32 | String getOverrideFileName(); 33 | } 34 | -------------------------------------------------------------------------------- /hansql-common/src/main/java/org/lealone/hansql/common/config/ConfigProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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.lealone.hansql.common.config; 19 | 20 | import com.typesafe.config.Config; 21 | 22 | public interface ConfigProvider { 23 | public Config getConfig(); 24 | } 25 | -------------------------------------------------------------------------------- /hansql-common/src/main/java/org/lealone/hansql/common/exceptions/RetryAfterSpillException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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.lealone.hansql.common.exceptions; 19 | 20 | /** 21 | * A special exception to be caught by caller, who is supposed to free memory by spilling and try again 22 | * 23 | */ 24 | public class RetryAfterSpillException extends Exception { 25 | 26 | } 27 | -------------------------------------------------------------------------------- /hansql-common/src/main/java/org/lealone/hansql/common/exceptions/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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 | * Various exceptions used in logical, physical and execution contexts. 20 | */ 21 | package org.lealone.hansql.common.exceptions; 22 | -------------------------------------------------------------------------------- /hansql-common/src/main/java/org/lealone/hansql/common/types/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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 | * Logical data types. 20 | */ 21 | package org.lealone.hansql.common.types; -------------------------------------------------------------------------------- /hansql-common/src/main/java/org/lealone/hansql/common/util/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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 | * Utilities useful across packages. 20 | */ 21 | package org.lealone.hansql.common.util; -------------------------------------------------------------------------------- /hansql-common/src/main/java/org/lealone/hansql/exec/memory/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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 | * Memory Allocation, Account and Management 20 | * 21 | * See the README.md file in this directory for detailed information about Drill's memory allocation subsystem. 22 | * 23 | */ 24 | package org.lealone.hansql.exec.memory; 25 | -------------------------------------------------------------------------------- /hansql-engine/src/main/resources/META-INF/services/org.lealone.server.ProtocolServerEngine: -------------------------------------------------------------------------------- 1 | org.lealone.hansql.engine.server.HanSQLServerEngine -------------------------------------------------------------------------------- /hansql-engine/src/main/resources/META-INF/services/org.lealone.sql.SQLEngine: -------------------------------------------------------------------------------- 1 | org.lealone.hansql.engine.sql.HanSQLEngine -------------------------------------------------------------------------------- /hansql-engine/src/main/resources/META-INF/services/org.lealone.sql.operator.OperatorFactory: -------------------------------------------------------------------------------- 1 | org.lealone.hansql.engine.operator.OlapOperatorFactory -------------------------------------------------------------------------------- /hansql-engine/src/main/resources/drill-module.conf: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one or more 2 | // contributor license agreements. See the NOTICE file distributed with 3 | // this work for additional information regarding copyright ownership. 4 | // The ASF licenses this file to You under the Apache License, Version 2.0 5 | // (the "License"); you may not use this file except in compliance with 6 | // the License. You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | // This file tells Drill to consider this module when class path scanning. 17 | // This file can also include any supplementary configuration information. 18 | // This file is in HOCON format, see https://github.com/typesafehub/config/blob/master/HOCON.md for more information. 19 | drill.classpath.scanning: { 20 | packages += "org.lealone.hansql.engine.storage" 21 | } 22 | -------------------------------------------------------------------------------- /hansql-executor/src/main/codegen/config.fmpp: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http:# www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | data: { 18 | # TODO: Rename to ~valueVectorModesAndTypes for clarity. 19 | vv: tdd(../data/ValueVectorTypes.tdd), 20 | parser: tdd(../data/Parser.tdd) 21 | } 22 | freemarkerLinks: { 23 | includes: includes/ 24 | } 25 | -------------------------------------------------------------------------------- /hansql-executor/src/main/codegen/includes/license.ftl: -------------------------------------------------------------------------------- 1 | <#-- 2 | 3 | Licensed to the Apache Software Foundation (ASF) under one 4 | or more contributor license agreements. See the NOTICE file 5 | distributed with this work for additional information 6 | regarding copyright ownership. The ASF licenses this file 7 | to you under the Apache License, Version 2.0 (the 8 | "License"); you may not use this file except in compliance 9 | with the License. You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | 19 | --> 20 | -------------------------------------------------------------------------------- /hansql-executor/src/main/java/org/lealone/hansql/exec/cache/Counter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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.lealone.hansql.exec.cache; 19 | 20 | public interface Counter { 21 | static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(Counter.class); 22 | public long get(); 23 | public long incrementAndGet(); 24 | public long decrementAndGet(); 25 | } 26 | -------------------------------------------------------------------------------- /hansql-executor/src/main/java/org/lealone/hansql/exec/cache/DistributedMultiMap.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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.lealone.hansql.exec.cache; 19 | 20 | import java.util.Collection; 21 | import java.util.concurrent.Future; 22 | 23 | public interface DistributedMultiMap { 24 | static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(DistributedMultiMap.class); 25 | public Collection get(K key); 26 | public Future put(K key, V value); 27 | } 28 | -------------------------------------------------------------------------------- /hansql-executor/src/main/java/org/lealone/hansql/exec/compile/CompilationConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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.lealone.hansql.exec.compile; 19 | 20 | import org.objectweb.asm.Opcodes; 21 | 22 | public class CompilationConfig { 23 | /* 24 | * Never use asm.Opcodes values directly in calls that require them. Use ASM_OPCODES 25 | * instead, so that we can change it here once for all references. 26 | */ 27 | public final static int ASM_API_VERSION = Opcodes.ASM7; 28 | } 29 | -------------------------------------------------------------------------------- /hansql-executor/src/main/java/org/lealone/hansql/exec/compile/sig/CodeGeneratorSignature.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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.lealone.hansql.exec.compile.sig; 19 | 20 | 21 | public interface CodeGeneratorSignature { 22 | } 23 | -------------------------------------------------------------------------------- /hansql-executor/src/main/java/org/lealone/hansql/exec/compile/sig/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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 | * TODO - write docs for this package 20 | */ 21 | package org.lealone.hansql.exec.compile.sig; -------------------------------------------------------------------------------- /hansql-executor/src/main/java/org/lealone/hansql/exec/coord/store/TransientStoreEventType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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.lealone.hansql.exec.coord.store; 19 | 20 | /** 21 | * Types of store events. 22 | */ 23 | public enum TransientStoreEventType { 24 | CREATE, 25 | UPDATE, 26 | DELETE 27 | } 28 | -------------------------------------------------------------------------------- /hansql-executor/src/main/java/org/lealone/hansql/exec/dotdrill/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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 | * Meta-data persistence format, used for views and other cluster-wide 20 | * persistent state. 21 | */ 22 | package org.lealone.hansql.exec.dotdrill; -------------------------------------------------------------------------------- /hansql-executor/src/main/java/org/lealone/hansql/exec/exception/FunctionValidationException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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.lealone.hansql.exec.exception; 19 | 20 | import org.lealone.hansql.common.exceptions.DrillRuntimeException; 21 | 22 | public class FunctionValidationException extends DrillRuntimeException { 23 | 24 | public FunctionValidationException(String message) { 25 | super(message); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /hansql-executor/src/main/java/org/lealone/hansql/exec/exception/JarValidationException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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.lealone.hansql.exec.exception; 19 | 20 | import org.lealone.hansql.common.exceptions.DrillRuntimeException; 21 | 22 | public class JarValidationException extends DrillRuntimeException { 23 | 24 | public JarValidationException(String message) { 25 | super(message); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /hansql-executor/src/main/java/org/lealone/hansql/exec/exception/OptimizerException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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.lealone.hansql.exec.exception; 19 | 20 | import org.lealone.hansql.exec.work.exception.SqlExecutorSetupException; 21 | 22 | public class OptimizerException extends SqlExecutorSetupException { 23 | public OptimizerException(String message, Throwable cause) { 24 | super(message, cause); 25 | } 26 | 27 | public OptimizerException(String s) { 28 | super(s); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /hansql-executor/src/main/java/org/lealone/hansql/exec/exception/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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 | * Execution-time exceptions. 20 | */ 21 | package org.lealone.hansql.exec.exception; -------------------------------------------------------------------------------- /hansql-executor/src/main/java/org/lealone/hansql/exec/expr/DrillAggFunc.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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.lealone.hansql.exec.expr; 19 | 20 | /** 21 | * Aggregate function interface. 22 | * 23 | */ 24 | public interface DrillAggFunc extends DrillFunc{ 25 | /** 26 | * Initialization for the beginning of the aggregation. 27 | * 28 | */ 29 | public void setup(); 30 | public void add(); 31 | public void output(); 32 | public void reset(); 33 | } 34 | -------------------------------------------------------------------------------- /hansql-executor/src/main/java/org/lealone/hansql/exec/expr/DrillFunc.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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.lealone.hansql.exec.expr; 19 | 20 | public interface DrillFunc { 21 | public static final String EXCEPTION_FUNCTION_NAME = "__throwException"; 22 | } 23 | -------------------------------------------------------------------------------- /hansql-executor/src/main/java/org/lealone/hansql/exec/expr/DrillSimpleFunc.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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.lealone.hansql.exec.expr; 19 | 20 | public interface DrillSimpleFunc extends DrillFunc { 21 | void setup(); 22 | void eval(); 23 | } 24 | -------------------------------------------------------------------------------- /hansql-executor/src/main/java/org/lealone/hansql/exec/expr/ExactStatisticsConstants.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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.lealone.hansql.exec.expr; 19 | 20 | public interface ExactStatisticsConstants { 21 | String MIN_VALUE = "minValue"; 22 | String MAX_VALUE = "maxValue"; 23 | String ROW_COUNT = "rowCount"; 24 | String NULLS_COUNT = "nullsCount"; 25 | 26 | String START = "start"; 27 | String LENGTH = "length"; 28 | } 29 | -------------------------------------------------------------------------------- /hansql-executor/src/main/java/org/lealone/hansql/exec/expr/FilterPredicate.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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.lealone.hansql.exec.expr; 19 | 20 | import org.lealone.hansql.exec.expr.stat.RowsMatch; 21 | 22 | public interface FilterPredicate> { 23 | RowsMatch matches(StatisticsProvider evaluator); 24 | } 25 | -------------------------------------------------------------------------------- /hansql-executor/src/main/java/org/lealone/hansql/exec/expr/fn/impl/SqlPatternMatcher.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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.lealone.hansql.exec.expr.fn.impl; 19 | 20 | import io.netty.buffer.DrillBuf; 21 | 22 | public interface SqlPatternMatcher { 23 | int match(int start, int end, DrillBuf drillBuf); 24 | } 25 | -------------------------------------------------------------------------------- /hansql-executor/src/main/java/org/lealone/hansql/exec/ops/Consumer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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.lealone.hansql.exec.ops; 19 | 20 | //TODO replace this when we switch to JDK8, which includes this 21 | public interface Consumer { 22 | 23 | void accept(T t); 24 | 25 | void interrupt(final InterruptedException e); 26 | } 27 | -------------------------------------------------------------------------------- /hansql-executor/src/main/java/org/lealone/hansql/exec/ops/ExchangeFragmentContext.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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.lealone.hansql.exec.ops; 19 | 20 | /** 21 | * This provides the resources required by an exchange operator. 22 | */ 23 | public interface ExchangeFragmentContext extends FragmentContext { 24 | void waitForSendComplete(); 25 | 26 | AccountingUserConnection getUserDataTunnel(); 27 | } 28 | -------------------------------------------------------------------------------- /hansql-executor/src/main/java/org/lealone/hansql/exec/ops/MetricDef.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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.lealone.hansql.exec.ops; 19 | 20 | /** 21 | * Interface that defines a metric. For example, {@link org.lealone.hansql.exec.physical.impl.join.HashJoinBatch.Metric}. 22 | */ 23 | public interface MetricDef { 24 | public String name(); 25 | public int metricId(); 26 | } 27 | -------------------------------------------------------------------------------- /hansql-executor/src/main/java/org/lealone/hansql/exec/ops/RootFragmentContext.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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.lealone.hansql.exec.ops; 19 | 20 | /** 21 | * Provides services needed by the {@link org.lealone.hansql.exec.FragmentExecutor}. 22 | */ 23 | public interface RootFragmentContext extends ExchangeFragmentContext { 24 | FragmentStats getStats(); 25 | 26 | void setExecutorState(final ExecutorState executorState); 27 | } 28 | -------------------------------------------------------------------------------- /hansql-executor/src/main/java/org/lealone/hansql/exec/physical/base/FragmentLeaf.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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.lealone.hansql.exec.physical.base; 19 | 20 | /** 21 | * A Physical Operator that can be the leaf node of one particular execution fragment. Typically includes Receivers and 22 | * Scans 23 | */ 24 | public interface FragmentLeaf extends PhysicalOperator { 25 | } 26 | -------------------------------------------------------------------------------- /hansql-executor/src/main/java/org/lealone/hansql/exec/physical/base/FragmentRoot.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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.lealone.hansql.exec.physical.base; 19 | 20 | /** 21 | * Describes the root operation within a particular Fragment. This includes 22 | * things like Sender nodes. 23 | */ 24 | 25 | public interface FragmentRoot extends FragmentLeaf { 26 | } 27 | -------------------------------------------------------------------------------- /hansql-executor/src/main/java/org/lealone/hansql/exec/physical/base/Leaf.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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.lealone.hansql.exec.physical.base; 19 | 20 | /** 21 | * An operator which specifically is a lowest level leaf node of a query plan across all possible fragments. Currently, the only operator that is a Leaf 22 | * node are GroupScan nodes. Ultimately this could include use of Cache scans and other types of atypical data production systems. 23 | */ 24 | public interface Leaf extends FragmentLeaf { 25 | } 26 | -------------------------------------------------------------------------------- /hansql-executor/src/main/java/org/lealone/hansql/exec/physical/base/Root.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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.lealone.hansql.exec.physical.base; 19 | 20 | /** 21 | * Marker interface describe the root of a query plan. Currently, this is constrained to Screen. 22 | */ 23 | public interface Root extends FragmentRoot { 24 | } 25 | -------------------------------------------------------------------------------- /hansql-executor/src/main/java/org/lealone/hansql/exec/physical/base/Scan.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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.lealone.hansql.exec.physical.base; 19 | 20 | 21 | public interface Scan extends Leaf { 22 | } 23 | -------------------------------------------------------------------------------- /hansql-executor/src/main/java/org/lealone/hansql/exec/physical/base/SubScan.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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.lealone.hansql.exec.physical.base; 19 | 20 | 21 | /** 22 | * A SubScan operator represents the data scanned by a particular major/minor fragment. This is in contrast to 23 | * a GroupScan operator, which represents all data scanned by a physical plan. 24 | */ 25 | public interface SubScan extends Scan { 26 | } 27 | -------------------------------------------------------------------------------- /hansql-executor/src/main/java/org/lealone/hansql/exec/physical/base/Writer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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.lealone.hansql.exec.physical.base; 19 | 20 | /** Writer physical operator */ 21 | public interface Writer extends PhysicalOperator{ 22 | 23 | } 24 | -------------------------------------------------------------------------------- /hansql-executor/src/main/java/org/lealone/hansql/exec/physical/impl/PhysicalConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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.lealone.hansql.exec.physical.impl; 19 | 20 | import java.lang.annotation.ElementType; 21 | import java.lang.annotation.Retention; 22 | import java.lang.annotation.RetentionPolicy; 23 | import java.lang.annotation.Target; 24 | 25 | @Target({ElementType.TYPE}) 26 | @Retention(RetentionPolicy.RUNTIME) 27 | public @interface PhysicalConfig { 28 | Class value(); 29 | } 30 | -------------------------------------------------------------------------------- /hansql-executor/src/main/java/org/lealone/hansql/exec/physical/impl/aggregate/BatchIterator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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.lealone.hansql.exec.physical.impl.aggregate; 19 | 20 | import org.lealone.hansql.exec.record.RecordBatch.IterOutcome; 21 | 22 | public interface BatchIterator { 23 | static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(BatchIterator.class); 24 | 25 | public IterOutcome next(); 26 | } 27 | -------------------------------------------------------------------------------- /hansql-executor/src/main/java/org/lealone/hansql/exec/physical/impl/common/Comparator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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.lealone.hansql.exec.physical.impl.common; 19 | 20 | /** 21 | * Comparator type. Used in Join and Aggregation operators. 22 | */ 23 | public enum Comparator { 24 | NONE, // No comparator 25 | EQUALS, // Equality comparator 26 | IS_NOT_DISTINCT_FROM // 'IS NOT DISTINCT FROM' comparator 27 | } -------------------------------------------------------------------------------- /hansql-executor/src/main/java/org/lealone/hansql/exec/physical/impl/common/IndexPointer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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.lealone.hansql.exec.physical.impl.common; 19 | 20 | public class IndexPointer { 21 | static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(IndexPointer.class); 22 | 23 | public int value; 24 | } 25 | -------------------------------------------------------------------------------- /hansql-executor/src/main/java/org/lealone/hansql/exec/physical/impl/filter/EvalSetupException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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.lealone.hansql.exec.physical.impl.filter; 19 | 20 | public class EvalSetupException extends Exception{ 21 | static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(EvalSetupException.class); 22 | } 23 | -------------------------------------------------------------------------------- /hansql-executor/src/main/java/org/lealone/hansql/exec/physical/impl/filter/EvaluationPredicate.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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.lealone.hansql.exec.physical.impl.filter; 19 | 20 | import org.lealone.hansql.exec.record.selection.SelectionVector2; 21 | 22 | public class EvaluationPredicate { 23 | private SelectionVector2 vector; 24 | 25 | EvaluationPredicate(String pred){ 26 | 27 | } 28 | 29 | 30 | } 31 | -------------------------------------------------------------------------------- /hansql-executor/src/main/java/org/lealone/hansql/exec/physical/impl/join/HashJoinHelperSizeCalculator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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.lealone.hansql.exec.physical.impl.join; 19 | 20 | public interface HashJoinHelperSizeCalculator { 21 | long calculateSize(HashJoinMemoryCalculator.PartitionStat partitionStat, double fragmentationFactor); 22 | } 23 | -------------------------------------------------------------------------------- /hansql-executor/src/main/java/org/lealone/hansql/exec/physical/impl/materialize/RecordMaterializer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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.lealone.hansql.exec.physical.impl.materialize; 19 | 20 | 21 | public interface RecordMaterializer { 22 | 23 | public QueryWritableBatch convertNext(); 24 | 25 | } 26 | -------------------------------------------------------------------------------- /hansql-executor/src/main/java/org/lealone/hansql/exec/physical/impl/partitionsender/PartitionOutgoingBatch.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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.lealone.hansql.exec.physical.impl.partitionsender; 19 | 20 | 21 | public interface PartitionOutgoingBatch { 22 | 23 | public long getTotalRecords(); 24 | 25 | public void terminate(); 26 | } 27 | -------------------------------------------------------------------------------- /hansql-executor/src/main/java/org/lealone/hansql/exec/physical/impl/project/OutputWidthVisitorState.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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.lealone.hansql.exec.physical.impl.project; 19 | 20 | public class OutputWidthVisitorState { 21 | 22 | ProjectMemoryManager manager; 23 | 24 | public OutputWidthVisitorState(ProjectMemoryManager manager) { 25 | this.manager = manager; 26 | } 27 | 28 | public ProjectMemoryManager getManager() { 29 | return manager; 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /hansql-executor/src/main/java/org/lealone/hansql/exec/physical/impl/scan/columns/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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 | * Handles the special "columns" column used by the text reader, 20 | * and available to similar readers. 21 | */ 22 | 23 | package org.lealone.hansql.exec.physical.impl.scan.columns; 24 | -------------------------------------------------------------------------------- /hansql-executor/src/main/java/org/lealone/hansql/exec/physical/impl/scan/file/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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 | * Handles optional file metadata columns: implicit columns and 20 | * partition columns. Not all data sources are files, and so not 21 | * all support these columns 22 | */ 23 | 24 | package org.lealone.hansql.exec.physical.impl.scan.file; 25 | -------------------------------------------------------------------------------- /hansql-executor/src/main/java/org/lealone/hansql/exec/physical/impl/spill/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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 | * Collection of classes shared by operators that implement spill-to-disk. 20 | */ 21 | 22 | package org.lealone.hansql.exec.physical.impl.spill; -------------------------------------------------------------------------------- /hansql-executor/src/main/java/org/lealone/hansql/exec/physical/rowSet/model/single/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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 | * This set of classes models the structure of a batch consisting 20 | * of single vectors (as contrasted with a hyper batch.) Provides tools 21 | * or metdata-based construction, allocation, reading and writing of 22 | * the vectors. 23 | *

24 | * The classes here walk the container/map/vector tree to apply 25 | * operations. 26 | */ 27 | 28 | package org.lealone.hansql.exec.physical.rowSet.model.single; -------------------------------------------------------------------------------- /hansql-executor/src/main/java/org/lealone/hansql/exec/planner/PlannerType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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.lealone.hansql.exec.planner; 19 | 20 | public enum PlannerType { 21 | HEP, HEP_BOTTOM_UP, VOLCANO 22 | } 23 | -------------------------------------------------------------------------------- /hansql-executor/src/main/java/org/lealone/hansql/exec/planner/common/DrillRelNode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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.lealone.hansql.exec.planner.common; 19 | 20 | import org.lealone.hansql.optimizer.rel.RelNode; 21 | 22 | public interface DrillRelNode extends RelNode { 23 | 24 | } 25 | -------------------------------------------------------------------------------- /hansql-executor/src/main/java/org/lealone/hansql/exec/planner/cost/DrillRelOptCost.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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.lealone.hansql.exec.planner.cost; 19 | 20 | import org.lealone.hansql.optimizer.plan.RelOptCost; 21 | 22 | 23 | public interface DrillRelOptCost extends RelOptCost { 24 | 25 | double getNetwork(); 26 | 27 | double getMemory(); 28 | 29 | } 30 | -------------------------------------------------------------------------------- /hansql-executor/src/main/java/org/lealone/hansql/exec/planner/cost/DrillRelOptCostFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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.lealone.hansql.exec.planner.cost; 19 | 20 | import org.lealone.hansql.optimizer.plan.RelOptCost; 21 | import org.lealone.hansql.optimizer.plan.RelOptCostFactory; 22 | 23 | public interface DrillRelOptCostFactory extends RelOptCostFactory { 24 | 25 | /** 26 | * Creates a cost object. 27 | */ 28 | RelOptCost makeCost(double rowCount, double cpu, double io, double network); 29 | } 30 | -------------------------------------------------------------------------------- /hansql-executor/src/main/java/org/lealone/hansql/exec/planner/fragment/FragmentVisitor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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.lealone.hansql.exec.planner.fragment; 19 | 20 | 21 | public interface FragmentVisitor { 22 | public T visit(Fragment n, V extra); 23 | } 24 | -------------------------------------------------------------------------------- /hansql-executor/src/main/java/org/lealone/hansql/exec/planner/index/IndexDiscover.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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.lealone.hansql.exec.planner.index; 19 | 20 | 21 | public interface IndexDiscover { 22 | IndexCollection getTableIndex(String tableName); 23 | } 24 | -------------------------------------------------------------------------------- /hansql-executor/src/main/java/org/lealone/hansql/exec/planner/index/StatisticsPayload.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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.lealone.hansql.exec.planner.index; 19 | 20 | public interface StatisticsPayload { 21 | double getRowCount(); 22 | double getLeadingRowCount(); 23 | double getAvgRowSize(); 24 | } 25 | -------------------------------------------------------------------------------- /hansql-executor/src/main/java/org/lealone/hansql/exec/planner/index/rules/MatchFunction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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.lealone.hansql.exec.planner.index.rules; 19 | 20 | import org.lealone.hansql.optimizer.plan.RelOptRuleCall; 21 | 22 | public interface MatchFunction { 23 | boolean match(RelOptRuleCall call); 24 | T onMatch(RelOptRuleCall call); 25 | } -------------------------------------------------------------------------------- /hansql-executor/src/main/java/org/lealone/hansql/exec/planner/logical/DrillViewInfoProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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.lealone.hansql.exec.planner.logical; 19 | 20 | /** 21 | * Interface used by Drill components such as InformationSchema generator to get view info. 22 | * All view tables need to implement this interface. 23 | */ 24 | public interface DrillViewInfoProvider { 25 | 26 | /** Get the query part of the view. */ 27 | String getViewSql(); 28 | } 29 | -------------------------------------------------------------------------------- /hansql-executor/src/main/java/org/lealone/hansql/exec/planner/physical/DrillScanPrel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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.lealone.hansql.exec.planner.physical; 19 | 20 | import org.lealone.hansql.exec.physical.base.GroupScan; 21 | 22 | public interface DrillScanPrel extends Prel, HasDistributionAffinity{ 23 | 24 | public GroupScan getGroupScan(); 25 | 26 | } 27 | -------------------------------------------------------------------------------- /hansql-executor/src/main/java/org/lealone/hansql/exec/planner/physical/HasDistributionAffinity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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.lealone.hansql.exec.planner.physical; 19 | 20 | import org.lealone.hansql.exec.planner.fragment.DistributionAffinity; 21 | 22 | /** 23 | * Implement this interface if a Prel has distribution affinity requirements. 24 | */ 25 | public interface HasDistributionAffinity { 26 | 27 | DistributionAffinity getDistributionAffinity(); 28 | } 29 | -------------------------------------------------------------------------------- /hansql-executor/src/main/java/org/lealone/hansql/exec/planner/sql/DynamicReturnType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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.lealone.hansql.exec.planner.sql; 19 | 20 | import org.lealone.hansql.optimizer.sql.type.ExplicitReturnTypeInference; 21 | 22 | class DynamicReturnType extends ExplicitReturnTypeInference { 23 | 24 | public static final DynamicReturnType INSTANCE = new DynamicReturnType(); 25 | 26 | public DynamicReturnType() { 27 | super(new DynamicType()); 28 | } 29 | } -------------------------------------------------------------------------------- /hansql-executor/src/main/java/org/lealone/hansql/exec/planner/sql/handlers/PrelFinalizable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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.lealone.hansql.exec.planner.sql.handlers; 19 | 20 | import org.lealone.hansql.exec.planner.physical.Prel; 21 | 22 | /** 23 | * A marker interface that means that this node should be finalized before execution planning. This allows calculations 24 | * not relevant to planning to be done only once. 25 | */ 26 | public interface PrelFinalizable { 27 | Prel finalizeRel(); 28 | 29 | } 30 | -------------------------------------------------------------------------------- /hansql-executor/src/main/java/org/lealone/hansql/exec/planner/sql/handlers/SimpleCommandResult.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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.lealone.hansql.exec.planner.sql.handlers; 19 | 20 | public class SimpleCommandResult { 21 | 22 | public boolean ok; 23 | public String summary; 24 | 25 | public SimpleCommandResult(boolean ok, String summary) { 26 | super(); 27 | this.ok = ok; 28 | this.summary = summary; 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /hansql-executor/src/main/java/org/lealone/hansql/exec/record/CloseableRecordBatch.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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.lealone.hansql.exec.record; 19 | 20 | public interface CloseableRecordBatch extends RecordBatch, AutoCloseable { 21 | 22 | } 23 | -------------------------------------------------------------------------------- /hansql-executor/src/main/java/org/lealone/hansql/exec/record/MaterializeVisitor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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.lealone.hansql.exec.record; 19 | 20 | public interface MaterializeVisitor { 21 | } 22 | -------------------------------------------------------------------------------- /hansql-executor/src/main/java/org/lealone/hansql/exec/record/metadata/SchemaContainer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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.lealone.hansql.exec.record.metadata; 19 | 20 | import org.lealone.hansql.exec.record.metadata.ColumnMetadata; 21 | 22 | /** 23 | * Magic that allows one schema builder to nest inside another 24 | * without needing to know the type of the parent. 25 | */ 26 | interface SchemaContainer { 27 | 28 | void addColumn(ColumnMetadata column); 29 | } 30 | -------------------------------------------------------------------------------- /hansql-executor/src/main/java/org/lealone/hansql/exec/record/metadata/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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 a fluent schema builder for use in tests. Handles all 20 | * forms of Drill schemas, with emphasis on ease of use for the typical 21 | * cases (flat schema or nested maps.) Enables construction of unions, 22 | * union lists (AKA "list vector") repeated lists and combinations of 23 | * the above structures. 24 | */ 25 | 26 | package org.lealone.hansql.exec.record.metadata; -------------------------------------------------------------------------------- /hansql-executor/src/main/java/org/lealone/hansql/exec/record/metadata/schema/parser/SchemaParsingException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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.lealone.hansql.exec.record.metadata.schema.parser; 19 | 20 | import org.lealone.hansql.common.exceptions.DrillRuntimeException; 21 | 22 | /** 23 | * Is thrown when parsing schema using ANTLR4 parser. 24 | */ 25 | public class SchemaParsingException extends DrillRuntimeException { 26 | 27 | public SchemaParsingException(String message) { 28 | super(message); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /hansql-executor/src/main/java/org/lealone/hansql/exec/resolver/FunctionResolverFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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.lealone.hansql.exec.resolver; 19 | 20 | import org.lealone.hansql.common.expression.FunctionCall; 21 | 22 | public class FunctionResolverFactory { 23 | public static FunctionResolver getResolver(FunctionCall call) { 24 | return new DefaultFunctionResolver(); 25 | } 26 | 27 | public static FunctionResolver getExactResolver(FunctionCall call) { 28 | return new ExactFunctionResolver(); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /hansql-executor/src/main/java/org/lealone/hansql/exec/serialization/InstanceSerializer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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.lealone.hansql.exec.serialization; 19 | 20 | import java.io.IOException; 21 | 22 | public interface InstanceSerializer { 23 | byte[] serialize(T instance) throws IOException; 24 | T deserialize(byte[] raw) throws IOException; 25 | } 26 | -------------------------------------------------------------------------------- /hansql-executor/src/main/java/org/lealone/hansql/exec/store/BatchExceededException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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.lealone.hansql.exec.store; 19 | 20 | import org.lealone.hansql.common.exceptions.DrillRuntimeException; 21 | 22 | public class BatchExceededException extends DrillRuntimeException { 23 | public BatchExceededException(int capacity, int attempted) { 24 | super("Batch exceeded in size. Capacity: " + capacity + ", Attempted: " + attempted); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /hansql-executor/src/main/java/org/lealone/hansql/exec/store/DistributedStorageEngine.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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.lealone.hansql.exec.store; 19 | 20 | public interface DistributedStorageEngine { 21 | public String getDfsName(); 22 | } 23 | -------------------------------------------------------------------------------- /hansql-executor/src/main/java/org/lealone/hansql/exec/store/dfs/MagicString.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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.lealone.hansql.exec.store.dfs; 19 | 20 | public class MagicString { 21 | private long offset; 22 | private byte[] bytes; 23 | 24 | public MagicString(long offset, byte[] bytes) { 25 | super(); 26 | this.offset = offset; 27 | this.bytes = bytes; 28 | } 29 | 30 | public long getOffset() { 31 | return offset; 32 | } 33 | 34 | public byte[] getBytes() { 35 | return bytes; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /hansql-executor/src/main/java/org/lealone/hansql/exec/store/dfs/easy/FileWork.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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.lealone.hansql.exec.store.dfs.easy; 19 | 20 | 21 | import org.apache.hadoop.fs.Path; 22 | 23 | public interface FileWork { 24 | 25 | Path getPath(); 26 | 27 | long getStart(); 28 | 29 | long getLength(); 30 | } 31 | -------------------------------------------------------------------------------- /hansql-executor/src/main/java/org/lealone/hansql/exec/store/dfs/text/reader/StreamFinishedPseudoException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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.lealone.hansql.exec.store.dfs.text.reader; 19 | 20 | class StreamFinishedPseudoException extends RuntimeException { 21 | 22 | public static final StreamFinishedPseudoException INSTANCE = new StreamFinishedPseudoException(); 23 | 24 | private StreamFinishedPseudoException() { 25 | super("", null, false, true); 26 | 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /hansql-executor/src/main/java/org/lealone/hansql/exec/store/dfs/text/reader/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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 | * Version 3 of the text reader. Hosts the "compliant" text reader on 20 | * the row set framework. 21 | */ 22 | package org.lealone.hansql.exec.store.dfs.text.reader; 23 | -------------------------------------------------------------------------------- /hansql-executor/src/main/java/org/lealone/hansql/exec/store/ischema/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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 | */ 21 | package org.lealone.hansql.exec.store.ischema; -------------------------------------------------------------------------------- /hansql-executor/src/main/java/org/lealone/hansql/exec/store/schedule/CompleteWork.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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.lealone.hansql.exec.store.schedule; 19 | 20 | 21 | /** 22 | * Container that holds a complete work unit. Can contain one or more partial units. 23 | */ 24 | public interface CompleteWork extends Comparable{ 25 | static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(CompleteWork.class); 26 | 27 | public long getTotalBytes(); 28 | public EndpointByteMap getByteMap(); 29 | } 30 | -------------------------------------------------------------------------------- /hansql-executor/src/main/java/org/lealone/hansql/exec/store/sys/BasePersistentStore.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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.lealone.hansql.exec.store.sys; 19 | 20 | import java.util.Iterator; 21 | import java.util.Map; 22 | 23 | public abstract class BasePersistentStore implements PersistentStore { 24 | 25 | @Override 26 | public Iterator> getAll() { 27 | return getRange(0, Integer.MAX_VALUE); 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /hansql-executor/src/main/java/org/lealone/hansql/exec/store/sys/PersistentStoreMode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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.lealone.hansql.exec.store.sys; 19 | 20 | /** 21 | * Defines operation mode of a {@link PersistentStore} instance. 22 | */ 23 | public enum PersistentStoreMode { 24 | PERSISTENT, 25 | BLOB_PERSISTENT 26 | } 27 | -------------------------------------------------------------------------------- /hansql-executor/src/main/java/org/lealone/hansql/exec/store/sys/store/provider/BasePersistentStoreProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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.lealone.hansql.exec.store.sys.store.provider; 19 | 20 | import org.lealone.hansql.exec.store.sys.PersistentStoreProvider; 21 | 22 | public abstract class BasePersistentStoreProvider implements PersistentStoreProvider { 23 | @Override 24 | public void start() throws Exception { } 25 | 26 | @Override 27 | public void close() throws Exception { } 28 | } 29 | -------------------------------------------------------------------------------- /hansql-executor/src/main/java/org/lealone/hansql/exec/util/Pointer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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.lealone.hansql.exec.util; 19 | 20 | public class Pointer { 21 | public volatile T value; 22 | 23 | public Pointer(){} 24 | 25 | public Pointer(T value){ 26 | this.value = value; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /hansql-executor/src/main/java/org/lealone/hansql/exec/work/exception/UnsupportedDataTypeException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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.lealone.hansql.exec.work.exception; 19 | 20 | public class UnsupportedDataTypeException extends SqlUnsupportedException { 21 | public UnsupportedDataTypeException(String drillJiraNumber, String message) { 22 | super(drillJiraNumber, message); 23 | } 24 | 25 | public UnsupportedDataTypeException(String errorMessage) { 26 | super(errorMessage); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /hansql-executor/src/main/java/org/lealone/hansql/exec/work/exception/UnsupportedFunctionException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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.lealone.hansql.exec.work.exception; 19 | 20 | public class UnsupportedFunctionException extends SqlUnsupportedException { 21 | public UnsupportedFunctionException(String drillJiraNumber, String message) { 22 | super(drillJiraNumber, message); 23 | } 24 | 25 | public UnsupportedFunctionException(String errorMessage) { 26 | super(errorMessage); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /hansql-executor/src/main/java/org/lealone/hansql/exec/work/exception/UnsupportedRelOperatorException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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.lealone.hansql.exec.work.exception; 19 | 20 | public class UnsupportedRelOperatorException extends SqlUnsupportedException { 21 | public UnsupportedRelOperatorException(String drillJiraNumber, String message) { 22 | super(drillJiraNumber, message); 23 | } 24 | 25 | public UnsupportedRelOperatorException(String errorMessage) { 26 | super(errorMessage); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /hansql-executor/src/main/java/org/lealone/hansql/metastore/LocationProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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.lealone.hansql.metastore; 19 | 20 | import org.apache.hadoop.fs.Path; 21 | 22 | /** 23 | * A metadata which has specific location. 24 | */ 25 | public interface LocationProvider { 26 | 27 | /** 28 | * Returns location of this metadata. 29 | * 30 | * @return metadata location 31 | */ 32 | Path getLocation(); 33 | } 34 | -------------------------------------------------------------------------------- /hansql-function/src/main/codegen/data/CastHigh.tdd: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http:# www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | { 18 | types: [ 19 | {value: true, from: "Int", to: "Float8" }, 20 | {value: true, from: "BigInt", to: "Float8" }, 21 | {value: true, from: "Float4", to: "Float8" }, 22 | {value: true, from: "Float8", to: "Float8" }, 23 | {value: false, from: "Decimal9"}, 24 | {value: false, from: "Decimal18"}, 25 | {value: false, from: "Decimal28Sparse"}, 26 | {value: false, from: "Decimal38Sparse"}, 27 | {value: false, from: "VarDecimal"} 28 | ] 29 | } 30 | -------------------------------------------------------------------------------- /hansql-function/src/main/codegen/data/ComparisonTypesDecimal.tdd: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http:# www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | { 17 | { decimalTypes: [ 18 | {name: "VarDecimal"}, 19 | {name: "Decimal28Sparse", storage: "5"}, 20 | {name: "Decimal38Sparse", storage: "6"}, 21 | {name: "Decimal28Dense", storage: "4"}, 22 | {name: "Decimal38Dense", storage: "3"}, 23 | {name: "Decimal9", storage: "int"}, 24 | {name: "Decimal18", storage: "long"} 25 | ] 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /hansql-function/src/main/codegen/data/DecimalAggrTypes2.tdd: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http:# www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | { 18 | aggrtypes: [ 19 | {className: "Avg", funcName: "avg", types: [ 20 | {inputType: "VarDecimal", outputType: "NullableVarDecimal", countRunningType: "BigInt"}, 21 | {inputType: "NullableVarDecimal", outputType: "NullableVarDecimal", countRunningType: "BigInt"} 22 | ] 23 | } 24 | ] 25 | } 26 | -------------------------------------------------------------------------------- /hansql-function/src/main/codegen/data/ExtractTypes.tdd: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http:# www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | { 18 | toTypes: [Second, Minute, Hour, Day, Month, Year], 19 | fromTypes: [Date, Time, TimeStamp, Interval, IntervalDay, IntervalYear] 20 | } 21 | -------------------------------------------------------------------------------- /hansql-function/src/main/codegen/data/IntervalNumericTypes.tdd: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http:# www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | { 17 | {interval: ["Interval", "IntervalDay", "IntervalYear"] }, 18 | {numeric: ["Int", "BigInt", "Float4", "Float8"] } 19 | } -------------------------------------------------------------------------------- /hansql-function/src/main/codegen/includes/license.ftl: -------------------------------------------------------------------------------- 1 | <#-- 2 | 3 | Licensed to the Apache Software Foundation (ASF) under one 4 | or more contributor license agreements. See the NOTICE file 5 | distributed with this work for additional information 6 | regarding copyright ownership. The ASF licenses this file 7 | to you under the Apache License, Version 2.0 (the 8 | "License"); you may not use this file except in compliance 9 | with the License. You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | 19 | --> 20 | -------------------------------------------------------------------------------- /hansql-function/src/main/resources/drill-module.conf: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one or more 2 | // contributor license agreements. See the NOTICE file distributed with 3 | // this work for additional information regarding copyright ownership. 4 | // The ASF licenses this file to You under the Apache License, Version 2.0 5 | // (the "License"); you may not use this file except in compliance with 6 | // the License. You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | // This file tells Drill to consider this module when class path scanning. 17 | // This file can also include any supplementary configuration information. 18 | // This file is in HOCON format, see https://github.com/typesafehub/config/blob/master/HOCON.md for more information. 19 | drill.classpath.scanning: { 20 | packages += "org.lealone.hansql.exec.expr.fn.impl" 21 | } 22 | -------------------------------------------------------------------------------- /hansql-logical/src/main/java/org/lealone/hansql/common/expression/FunctionName.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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.lealone.hansql.common.expression; 19 | 20 | import java.lang.annotation.ElementType; 21 | import java.lang.annotation.Retention; 22 | import java.lang.annotation.RetentionPolicy; 23 | import java.lang.annotation.Target; 24 | 25 | @Retention(RetentionPolicy.RUNTIME) 26 | @Target({ElementType.TYPE}) 27 | public @interface FunctionName { 28 | String value(); 29 | } 30 | -------------------------------------------------------------------------------- /hansql-logical/src/main/java/org/lealone/hansql/common/expression/ValidationError.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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.lealone.hansql.common.expression; 19 | 20 | public class ValidationError { 21 | 22 | } 23 | -------------------------------------------------------------------------------- /hansql-logical/src/main/java/org/lealone/hansql/common/expression/fn/FuncHolder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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.lealone.hansql.common.expression.fn; 19 | 20 | /** This should be removed once common and exec/java-exec modules are merged (DRILL-507). */ 21 | public interface FuncHolder { 22 | 23 | } 24 | -------------------------------------------------------------------------------- /hansql-logical/src/main/java/org/lealone/hansql/common/expression/fn/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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 | * Logical function definitions. 20 | */ 21 | package org.lealone.hansql.common.expression.fn; -------------------------------------------------------------------------------- /hansql-logical/src/main/java/org/lealone/hansql/common/expression/types/DataTypeFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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.lealone.hansql.common.expression.types; 19 | 20 | public abstract class DataTypeFactory { 21 | 22 | public abstract DataType getArrayType(DataType containedType); 23 | public abstract DataType getMapType(DataType keyType, DataType valueType); 24 | 25 | } 26 | -------------------------------------------------------------------------------- /hansql-logical/src/main/java/org/lealone/hansql/common/expression/types/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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 | * Logical type definitions. 20 | */ 21 | package org.lealone.hansql.common.expression.types; -------------------------------------------------------------------------------- /hansql-logical/src/main/java/org/lealone/hansql/common/expression/visitors/ExpressionValidationError.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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.lealone.hansql.common.expression.visitors; 19 | 20 | public class ExpressionValidationError { 21 | String message; 22 | 23 | public ExpressionValidationError(String message) { 24 | this.message = message; 25 | } 26 | 27 | @Override 28 | public String toString() { 29 | return message; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /hansql-logical/src/main/java/org/lealone/hansql/common/expression/visitors/OpVisitor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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.lealone.hansql.common.expression.visitors; 19 | 20 | import org.lealone.hansql.common.graph.GraphVisitor; 21 | import org.lealone.hansql.common.logical.data.LogicalOperator; 22 | 23 | public interface OpVisitor extends GraphVisitor { 24 | } 25 | -------------------------------------------------------------------------------- /hansql-logical/src/main/java/org/lealone/hansql/common/expression/visitors/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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 | * Visitors for validating or optimizing logical expressions. 20 | * 21 | * These visitors are used to provide feedback to users on invalid expressions 22 | * as well as some basic optimizations applied during planning. 23 | */ 24 | package org.lealone.hansql.common.expression.visitors; -------------------------------------------------------------------------------- /hansql-logical/src/main/java/org/lealone/hansql/common/graph/GraphValue.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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.lealone.hansql.common.graph; 19 | 20 | public interface GraphValue extends Iterable{ 21 | void accept(GraphVisitor visitor); 22 | } 23 | -------------------------------------------------------------------------------- /hansql-logical/src/main/java/org/lealone/hansql/common/graph/GraphVisitor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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.lealone.hansql.common.graph; 19 | 20 | 21 | public interface GraphVisitor { 22 | public boolean enter(T o); 23 | public void leave(T o); 24 | public boolean visit(T o); 25 | } 26 | -------------------------------------------------------------------------------- /hansql-logical/src/main/java/org/lealone/hansql/common/graph/Visitable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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.lealone.hansql.common.graph; 19 | 20 | public interface Visitable> { 21 | public void accept(T node); 22 | } 23 | -------------------------------------------------------------------------------- /hansql-logical/src/main/java/org/lealone/hansql/common/graph/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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 | * Connected-graph representation shared by logical and physical query graphs. 20 | */ 21 | package org.lealone.hansql.common.graph; -------------------------------------------------------------------------------- /hansql-logical/src/main/java/org/lealone/hansql/common/logical/UnexpectedOperatorType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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.lealone.hansql.common.logical; 19 | 20 | 21 | public class UnexpectedOperatorType extends ValidationError{ 22 | 23 | public UnexpectedOperatorType(String message){ 24 | super(message); 25 | } 26 | 27 | public UnexpectedOperatorType(Object operator, String message) { 28 | super(message + " Received node of type " + operator.getClass().getCanonicalName()); 29 | } 30 | 31 | 32 | 33 | 34 | 35 | } 36 | -------------------------------------------------------------------------------- /hansql-logical/src/main/java/org/lealone/hansql/common/logical/data/AbstractBuilder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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.lealone.hansql.common.logical.data; 19 | 20 | public abstract class AbstractBuilder { 21 | static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(AbstractBuilder.class); 22 | 23 | public abstract T build(); 24 | } 25 | -------------------------------------------------------------------------------- /hansql-logical/src/main/java/org/lealone/hansql/common/logical/data/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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 | * Logical operators in a query graph. 20 | */ 21 | package org.lealone.hansql.common.logical.data; -------------------------------------------------------------------------------- /hansql-logical/src/main/java/org/lealone/hansql/common/logical/data/visitors/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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 | * Visitors for Drill logical plan graphs. 20 | */ 21 | package org.lealone.hansql.common.logical.data.visitors; 22 | -------------------------------------------------------------------------------- /hansql-logical/src/main/java/org/lealone/hansql/common/logical/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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 | * Storage plugin interfaces and logical plan representation. 20 | * 21 | * This package includes the interface for storage and format plugins for Drill 22 | * as well as the top level class for representing a Drill logical plan and a 23 | * builder for constructing plans. 24 | */ 25 | package org.lealone.hansql.common.logical; -------------------------------------------------------------------------------- /hansql-optimizer/src/main/codegen/includes/compoundIdentifier.ftl: -------------------------------------------------------------------------------- 1 | <#-- 2 | // Licensed to the Apache Software Foundation (ASF) under one or more 3 | // contributor license agreements. See the NOTICE file distributed with 4 | // this work for additional information regarding copyright ownership. 5 | // The ASF licenses this file to you under the Apache License, Version 2.0 6 | // (the "License"); you may not use this file except in compliance with 7 | // the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | --> 17 | 18 | <#-- 19 | Add implementations of additional parser statements, literals or 20 | data types. 21 | 22 | Example of SqlShowTables() implementation: 23 | SqlNode SqlShowTables() 24 | { 25 | ...local variables... 26 | } 27 | { 28 | 29 | ... 30 | { 31 | return SqlShowTables(...) 32 | } 33 | } 34 | --> 35 | -------------------------------------------------------------------------------- /hansql-optimizer/src/main/codegen/includes/parserImpls.ftl: -------------------------------------------------------------------------------- 1 | <#-- 2 | // Licensed to the Apache Software Foundation (ASF) under one or more 3 | // contributor license agreements. See the NOTICE file distributed with 4 | // this work for additional information regarding copyright ownership. 5 | // The ASF licenses this file to you under the Apache License, Version 2.0 6 | // (the "License"); you may not use this file except in compliance with 7 | // the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | --> 17 | 18 | <#-- 19 | Add implementations of additional parser statements, literals or 20 | data types. 21 | 22 | Example of SqlShowTables() implementation: 23 | SqlNode SqlShowTables() 24 | { 25 | ...local variables... 26 | } 27 | { 28 | 29 | ... 30 | { 31 | return SqlShowTables(...) 32 | } 33 | } 34 | --> 35 | -------------------------------------------------------------------------------- /hansql-optimizer/src/main/java/org/lealone/hansql/optimizer/config/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | /** 19 | * Configuration. 20 | */ 21 | @PackageMarker 22 | package org.lealone.hansql.optimizer.config; 23 | 24 | import org.lealone.hansql.optimizer.util.PackageMarker; 25 | 26 | // End package-info.java 27 | -------------------------------------------------------------------------------- /hansql-optimizer/src/main/java/org/lealone/hansql/optimizer/plan/hep/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | /** 19 | * Provides a heuristic planner implementation for the interfaces in 20 | * {@link org.lealone.hansql.optimizer.plan}. 21 | */ 22 | @PackageMarker 23 | package org.lealone.hansql.optimizer.plan.hep; 24 | 25 | import org.lealone.hansql.optimizer.util.PackageMarker; 26 | 27 | // End package-info.java 28 | -------------------------------------------------------------------------------- /hansql-optimizer/src/main/java/org/lealone/hansql/optimizer/plan/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | /** 19 | * Defines interfaces for constructing rule-based optimizers of 20 | * relational expressions. 21 | */ 22 | @PackageMarker 23 | package org.lealone.hansql.optimizer.plan; 24 | 25 | import org.lealone.hansql.optimizer.util.PackageMarker; 26 | 27 | // End package-info.java 28 | -------------------------------------------------------------------------------- /hansql-optimizer/src/main/java/org/lealone/hansql/optimizer/rel/convert/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | /** 19 | * Defines relational expressions and rules for converting between calling 20 | * conventions. 21 | */ 22 | @PackageMarker 23 | package org.lealone.hansql.optimizer.rel.convert; 24 | 25 | import org.lealone.hansql.optimizer.util.PackageMarker; 26 | 27 | // End package-info.java 28 | -------------------------------------------------------------------------------- /hansql-optimizer/src/main/java/org/lealone/hansql/optimizer/rel/externalize/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | /** 19 | * Facilities to externalize {@link org.lealone.hansql.optimizer.rel.RelNode}s to and from 20 | * XML and JSON format. 21 | */ 22 | @PackageMarker 23 | package org.lealone.hansql.optimizer.rel.externalize; 24 | 25 | import org.lealone.hansql.optimizer.util.PackageMarker; 26 | 27 | // End package-info.java 28 | -------------------------------------------------------------------------------- /hansql-optimizer/src/main/java/org/lealone/hansql/optimizer/rel/metadata/MetadataHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.lealone.hansql.optimizer.rel.metadata; 18 | 19 | /** 20 | * Marker interface for a handler of metadata. 21 | * 22 | * @param Kind of metadata 23 | */ 24 | public interface MetadataHandler { 25 | MetadataDef getDef(); 26 | } 27 | 28 | // End MetadataHandler.java 29 | -------------------------------------------------------------------------------- /hansql-optimizer/src/main/java/org/lealone/hansql/optimizer/rel/metadata/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | /** 19 | * Defines metadata interfaces and utilities for relational 20 | * expressions. 21 | */ 22 | @PackageMarker 23 | package org.lealone.hansql.optimizer.rel.metadata; 24 | 25 | import org.lealone.hansql.optimizer.util.PackageMarker; 26 | 27 | // End package-info.java 28 | -------------------------------------------------------------------------------- /hansql-optimizer/src/main/java/org/lealone/hansql/optimizer/rel/rel2sql/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | /** 19 | * Translates a relational expression to SQL parse tree. 20 | */ 21 | @PackageMarker 22 | package org.lealone.hansql.optimizer.rel.rel2sql; 23 | 24 | import org.lealone.hansql.optimizer.util.PackageMarker; 25 | 26 | // End package-info.java 27 | -------------------------------------------------------------------------------- /hansql-optimizer/src/main/java/org/lealone/hansql/optimizer/rel/type/RelDataTypeFamily.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.lealone.hansql.optimizer.rel.type; 18 | 19 | /** 20 | * RelDataTypeFamily represents a family of related types. The specific criteria 21 | * for membership in a type family are type-system dependent. 22 | */ 23 | public interface RelDataTypeFamily { 24 | } 25 | 26 | // End RelDataTypeFamily.java 27 | -------------------------------------------------------------------------------- /hansql-optimizer/src/main/java/org/lealone/hansql/optimizer/rel/type/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | /** 19 | * Defines a type system for relational expressions. 20 | */ 21 | @PackageMarker 22 | package org.lealone.hansql.optimizer.rel.type; 23 | 24 | import org.lealone.hansql.optimizer.util.PackageMarker; 25 | 26 | // End package-info.java 27 | -------------------------------------------------------------------------------- /hansql-optimizer/src/main/java/org/lealone/hansql/optimizer/rex/RexAction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.lealone.hansql.optimizer.rex; 18 | 19 | /** 20 | * A RexAction is called when a {@link RexPattern} finds a match. 21 | * It yields a {@link RexNode} by substituting the matching tokens. 22 | */ 23 | public interface RexAction { 24 | //~ Methods ---------------------------------------------------------------- 25 | 26 | void onMatch(RexNode[] tokens); 27 | } 28 | 29 | // End RexAction.java 30 | -------------------------------------------------------------------------------- /hansql-optimizer/src/main/java/org/lealone/hansql/optimizer/rex/RexDigestIncludeType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.lealone.hansql.optimizer.rex; 18 | 19 | /** 20 | * Defines if type information should be printed for {@link RexLiteral}. 21 | */ 22 | public enum RexDigestIncludeType { 23 | ALWAYS, 24 | OPTIONAL, 25 | NO_TYPE; 26 | } 27 | 28 | // End RexDigestIncludeType.java 29 | -------------------------------------------------------------------------------- /hansql-optimizer/src/main/java/org/lealone/hansql/optimizer/rex/RexDynamicParam.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.lealone.hansql.optimizer.rex; 18 | 19 | /** 20 | * Dynamic parameter reference in a row-expression. 21 | */ 22 | public interface RexDynamicParam extends RexSlot { 23 | } 24 | -------------------------------------------------------------------------------- /hansql-optimizer/src/main/java/org/lealone/hansql/optimizer/rex/RexSlot.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.lealone.hansql.optimizer.rex; 18 | 19 | /** 20 | * Abstract base class for {@link RexInputRef} and {@link RexLocalRef}. 21 | */ 22 | public interface RexSlot extends RexVariable { 23 | 24 | int getIndex(); 25 | } 26 | -------------------------------------------------------------------------------- /hansql-optimizer/src/main/java/org/lealone/hansql/optimizer/rex/RexSqlConvertletTable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.lealone.hansql.optimizer.rex; 18 | 19 | /** 20 | * Collection of {@link RexSqlConvertlet}s. 21 | */ 22 | public interface RexSqlConvertletTable { 23 | //~ Methods ---------------------------------------------------------------- 24 | 25 | /** 26 | * Returns the convertlet applicable to a given expression. 27 | */ 28 | RexSqlConvertlet get(RexCall call); 29 | } 30 | 31 | // End RexSqlConvertletTable.java 32 | -------------------------------------------------------------------------------- /hansql-optimizer/src/main/java/org/lealone/hansql/optimizer/rex/RexVariable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.lealone.hansql.optimizer.rex; 18 | 19 | /** 20 | * A row-expression which references a field. 21 | */ 22 | public interface RexVariable extends RexNode { 23 | 24 | /** 25 | * Returns the name of this variable. 26 | */ 27 | String getName(); 28 | } 29 | -------------------------------------------------------------------------------- /hansql-optimizer/src/main/java/org/lealone/hansql/optimizer/schema/PreparingTable.java: -------------------------------------------------------------------------------- 1 | package org.lealone.hansql.optimizer.schema; 2 | 3 | import org.lealone.hansql.optimizer.plan.RelOptTable; 4 | import org.lealone.hansql.optimizer.sql.validate.SqlValidatorTable; 5 | 6 | /** Definition of a table, for the purposes of the validator and planner. */ 7 | public interface PreparingTable 8 | extends RelOptTable, SqlValidatorTable { 9 | } -------------------------------------------------------------------------------- /hansql-optimizer/src/main/java/org/lealone/hansql/optimizer/schema/QueryableTable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.lealone.hansql.optimizer.schema; 18 | 19 | import java.lang.reflect.Type; 20 | 21 | /** 22 | * Extension to {@link Table} that can translate itself to a {@link Queryable}. 23 | */ 24 | public interface QueryableTable extends Table { 25 | 26 | /** Returns the element type of the collection that will implement this 27 | * table. */ 28 | Type getElementType(); 29 | 30 | } 31 | 32 | // End QueryableTable.java 33 | -------------------------------------------------------------------------------- /hansql-optimizer/src/main/java/org/lealone/hansql/optimizer/schema/Wrapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.lealone.hansql.optimizer.schema; 18 | 19 | /** 20 | * Mix-in interface that allows you to find sub-objects. 21 | */ 22 | public interface Wrapper { 23 | /** Finds an instance of an interface implemented by this object, 24 | * or returns null if this object does not support that interface. */ 25 | C unwrap(Class aClass); 26 | } 27 | 28 | // End Wrapper.java 29 | -------------------------------------------------------------------------------- /hansql-optimizer/src/main/java/org/lealone/hansql/optimizer/schema/impl/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | /** 19 | * Utilities to help implement Calcite's SPIs. 20 | */ 21 | @PackageMarker 22 | package org.lealone.hansql.optimizer.schema.impl; 23 | 24 | import org.lealone.hansql.optimizer.util.PackageMarker; 25 | 26 | // End package-info.java 27 | -------------------------------------------------------------------------------- /hansql-optimizer/src/main/java/org/lealone/hansql/optimizer/schema/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | /** 19 | * Schema SPI. 20 | * 21 | *

The interfaces in this package define the objects used by the 22 | * SQL validator to validate SQL abstract syntax trees and resolve 23 | * identifiers to objects. 24 | */ 25 | @PackageMarker 26 | package org.lealone.hansql.optimizer.schema; 27 | 28 | import org.lealone.hansql.optimizer.util.PackageMarker; 29 | 30 | // End package-info.java 31 | -------------------------------------------------------------------------------- /hansql-optimizer/src/main/java/org/lealone/hansql/optimizer/sql/SqlAccessEnum.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.lealone.hansql.optimizer.sql; 18 | 19 | /** 20 | * Enumeration representing different access types 21 | */ 22 | public enum SqlAccessEnum { 23 | SELECT, UPDATE, INSERT, DELETE; 24 | } 25 | 26 | // End SqlAccessEnum.java 27 | -------------------------------------------------------------------------------- /hansql-optimizer/src/main/java/org/lealone/hansql/optimizer/sql/SqlJsonExistsErrorBehavior.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.lealone.hansql.optimizer.sql; 18 | 19 | /** 20 | * Categorizing Json exists error behaviors. 21 | */ 22 | public enum SqlJsonExistsErrorBehavior { 23 | TRUE, 24 | FALSE, 25 | UNKNOWN, 26 | ERROR 27 | } 28 | 29 | // End SqlJsonExistsErrorBehavior.java 30 | -------------------------------------------------------------------------------- /hansql-optimizer/src/main/java/org/lealone/hansql/optimizer/sql/SqlJsonQueryWrapperBehavior.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.lealone.hansql.optimizer.sql; 18 | 19 | /** 20 | * How json query function handle array result. 21 | */ 22 | public enum SqlJsonQueryWrapperBehavior { 23 | WITHOUT_ARRAY, 24 | WITH_CONDITIONAL_ARRAY, 25 | WITH_UNCONDITIONAL_ARRAY 26 | } 27 | 28 | // End SqlJsonQueryWrapperBehavior.java 29 | -------------------------------------------------------------------------------- /hansql-optimizer/src/main/java/org/lealone/hansql/optimizer/sql/dialect/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | /** 19 | * SQL unparsers for JDBC dialects. 20 | */ 21 | @PackageMarker 22 | package org.lealone.hansql.optimizer.sql.dialect; 23 | 24 | import org.lealone.hansql.optimizer.util.PackageMarker; 25 | 26 | // End package-info.java 27 | -------------------------------------------------------------------------------- /hansql-optimizer/src/main/java/org/lealone/hansql/optimizer/sql/parser/impl/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | /** 19 | * Contains generated code for the 20 | * {@link org.lealone.hansql.optimizer.sql.parser Calcite SQL parser}. 21 | */ 22 | @PackageMarker 23 | package org.lealone.hansql.optimizer.sql.parser.impl; 24 | 25 | import org.lealone.hansql.optimizer.util.PackageMarker; 26 | 27 | // End package-info.java 28 | -------------------------------------------------------------------------------- /hansql-optimizer/src/main/java/org/lealone/hansql/optimizer/sql/parser/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | /** 19 | * Provides a SQL parser. 20 | */ 21 | @PackageMarker 22 | package org.lealone.hansql.optimizer.sql.parser; 23 | 24 | import org.lealone.hansql.optimizer.util.PackageMarker; 25 | 26 | // End package-info.java 27 | -------------------------------------------------------------------------------- /hansql-optimizer/src/main/java/org/lealone/hansql/optimizer/sql/pretty/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | /** 19 | * Provides a pretty-printer for SQL statements. 20 | */ 21 | @PackageMarker 22 | package org.lealone.hansql.optimizer.sql.pretty; 23 | 24 | import org.lealone.hansql.optimizer.util.PackageMarker; 25 | 26 | // End package-info.java 27 | -------------------------------------------------------------------------------- /hansql-optimizer/src/main/java/org/lealone/hansql/optimizer/sql/type/OperandsTypeChecking.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.lealone.hansql.optimizer.sql.type; 18 | 19 | /** 20 | * Strategies to check for allowed operand types of an operator call. 21 | */ 22 | public abstract class OperandsTypeChecking { 23 | } 24 | 25 | // End OperandsTypeChecking.java 26 | -------------------------------------------------------------------------------- /hansql-optimizer/src/main/java/org/lealone/hansql/optimizer/sql/type/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | /** 19 | * SQL type system. 20 | */ 21 | @PackageMarker 22 | package org.lealone.hansql.optimizer.sql.type; 23 | 24 | import org.lealone.hansql.optimizer.util.PackageMarker; 25 | 26 | // End package-info.java 27 | -------------------------------------------------------------------------------- /hansql-optimizer/src/main/java/org/lealone/hansql/optimizer/sql/util/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | /** 19 | * Utility classes for the SQL object model, parsing, and validation. 20 | */ 21 | @PackageMarker 22 | package org.lealone.hansql.optimizer.sql.util; 23 | 24 | import org.lealone.hansql.optimizer.util.PackageMarker; 25 | 26 | // End package-info.java 27 | -------------------------------------------------------------------------------- /hansql-optimizer/src/main/java/org/lealone/hansql/optimizer/sql/validate/SqlModality.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.lealone.hansql.optimizer.sql.validate; 18 | 19 | /** Relational or streaming. */ 20 | public enum SqlModality { 21 | RELATION, 22 | STREAM 23 | } 24 | 25 | // End SqlModality.java 26 | -------------------------------------------------------------------------------- /hansql-optimizer/src/main/java/org/lealone/hansql/optimizer/sql/validate/SqlMonikerType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.lealone.hansql.optimizer.sql.validate; 18 | 19 | /** 20 | * An enumeration of moniker types. 21 | * 22 | *

Used in {@link SqlMoniker}. 23 | */ 24 | public enum SqlMonikerType { 25 | COLUMN, TABLE, VIEW, SCHEMA, CATALOG, REPOSITORY, FUNCTION, KEYWORD 26 | } 27 | 28 | // End SqlMonikerType.java 29 | -------------------------------------------------------------------------------- /hansql-optimizer/src/main/java/org/lealone/hansql/optimizer/sql/validate/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | /** 19 | * SQL validation. 20 | */ 21 | @PackageMarker 22 | package org.lealone.hansql.optimizer.sql.validate; 23 | 24 | import org.lealone.hansql.optimizer.util.PackageMarker; 25 | 26 | // End package-info.java 27 | -------------------------------------------------------------------------------- /hansql-optimizer/src/main/java/org/lealone/hansql/optimizer/sql2rel/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | /** 19 | * Translates a SQL parse tree to relational expression. 20 | */ 21 | @PackageMarker 22 | package org.lealone.hansql.optimizer.sql2rel; 23 | 24 | import org.lealone.hansql.optimizer.util.PackageMarker; 25 | 26 | // End package-info.java 27 | -------------------------------------------------------------------------------- /hansql-optimizer/src/main/java/org/lealone/hansql/optimizer/tools/RuleSet.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.lealone.hansql.optimizer.tools; 18 | 19 | import org.lealone.hansql.optimizer.plan.RelOptRule; 20 | 21 | /** 22 | * A set rules associated with a particular 23 | * type of invocation of the {@link Planner}. 24 | */ 25 | public interface RuleSet extends Iterable { 26 | } 27 | 28 | // End RuleSet.java 29 | -------------------------------------------------------------------------------- /hansql-optimizer/src/main/java/org/lealone/hansql/optimizer/tools/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | /** 19 | * Provides utility classes. 20 | */ 21 | @PackageMarker 22 | package org.lealone.hansql.optimizer.tools; 23 | 24 | import org.lealone.hansql.optimizer.util.PackageMarker; 25 | 26 | // End package-info.java 27 | -------------------------------------------------------------------------------- /hansql-optimizer/src/main/java/org/lealone/hansql/optimizer/util/CalciteParserException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.lealone.hansql.optimizer.util; 18 | 19 | /** 20 | * Tagging interface to allow a 21 | * {@link org.lealone.hansql.optimizer.sql.parser.SqlParseException} 22 | * to be identified without adding a 23 | * dependency on it from client-side code. 24 | */ 25 | public interface CalciteParserException { 26 | } 27 | 28 | // End CalciteParserException.java 29 | -------------------------------------------------------------------------------- /hansql-optimizer/src/main/java/org/lealone/hansql/optimizer/util/CalciteValidatorException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.lealone.hansql.optimizer.util; 18 | 19 | /** 20 | * Tagging interface to allow a 21 | * {@link org.lealone.hansql.optimizer.sql.validate.SqlValidatorException} 22 | * to be identified without 23 | * adding a dependency on it from client-side code. 24 | */ 25 | public interface CalciteValidatorException { 26 | } 27 | 28 | // End CalciteValidatorException.java 29 | -------------------------------------------------------------------------------- /hansql-optimizer/src/main/java/org/lealone/hansql/optimizer/util/function/Function.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.lealone.hansql.optimizer.util.function; 18 | 19 | /** 20 | * Base interface for all functions. 21 | * 22 | * @param Result type 23 | */ 24 | public interface Function { 25 | } 26 | 27 | // End Function.java 28 | -------------------------------------------------------------------------------- /hansql-optimizer/src/main/java/org/lealone/hansql/optimizer/util/function/Function0.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.lealone.hansql.optimizer.util.function; 18 | 19 | /** 20 | * Function with no parameters. 21 | * 22 | * @param Result type 23 | */ 24 | public interface Function0 extends Function { 25 | R apply(); 26 | } 27 | 28 | // End Function0.java 29 | -------------------------------------------------------------------------------- /hansql-optimizer/src/main/java/org/lealone/hansql/optimizer/util/function/Function2.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.lealone.hansql.optimizer.util.function; 18 | 19 | /** 20 | * Function with two parameters. 21 | * 22 | * @param Result type 23 | * @param Type of argument #0 24 | * @param Type of argument #1 25 | */ 26 | public interface Function2 extends Function { 27 | R apply(T0 v0, T1 v1); 28 | } 29 | 30 | // End Function2.java 31 | -------------------------------------------------------------------------------- /hansql-optimizer/src/main/java/org/lealone/hansql/optimizer/util/graph/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | /** 19 | * Graph-theoretic algorithms and data structures. 20 | */ 21 | @PackageMarker 22 | package org.lealone.hansql.optimizer.util.graph; 23 | 24 | import org.lealone.hansql.optimizer.util.PackageMarker; 25 | 26 | // End package-info.java 27 | -------------------------------------------------------------------------------- /hansql-optimizer/src/main/java/org/lealone/hansql/optimizer/util/javac/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | /** 19 | * Provides compilers for Java code. 20 | */ 21 | @PackageMarker 22 | package org.lealone.hansql.optimizer.util.javac; 23 | 24 | import org.lealone.hansql.optimizer.util.PackageMarker; 25 | 26 | // End package-info.java 27 | -------------------------------------------------------------------------------- /hansql-optimizer/src/main/java/org/lealone/hansql/optimizer/util/mapping/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | /** 19 | * Support for algebraic maps. 20 | */ 21 | @PackageMarker 22 | package org.lealone.hansql.optimizer.util.mapping; 23 | 24 | import org.lealone.hansql.optimizer.util.PackageMarker; 25 | 26 | // End package-info.java 27 | -------------------------------------------------------------------------------- /hansql-optimizer/src/main/java/org/lealone/hansql/optimizer/util/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | /** 19 | * Provides utility classes. 20 | */ 21 | @PackageMarker 22 | package org.lealone.hansql.optimizer.util; 23 | 24 | // End package-info.java 25 | -------------------------------------------------------------------------------- /hansql-optimizer/src/main/java/org/lealone/hansql/optimizer/util/trace/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | /** 19 | * Tracing services. 20 | */ 21 | @PackageMarker 22 | package org.lealone.hansql.optimizer.util.trace; 23 | 24 | import org.lealone.hansql.optimizer.util.PackageMarker; 25 | 26 | // End package-info.java 27 | -------------------------------------------------------------------------------- /hansql-test/src/test/java/org/lealone/hansql/test/HanEngineStart.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright Lealone Database Group. 3 | * Licensed under the Server Side Public License, v 1. 4 | * Initial Developer: zhh 5 | */ 6 | package org.lealone.hansql.test; 7 | 8 | import org.lealone.main.Lealone; 9 | import org.lealone.main.config.Config; 10 | 11 | //加上-Xbootclasspath/a:../hansql-function/target/generated-sources;../hansql-function/src/main/java 12 | public class HanEngineStart { 13 | 14 | public static void main(String[] args) { 15 | Config.setProperty("config", "lealone-test.yaml"); 16 | Lealone.main(args); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /hansql-test/src/test/resources/log4j2-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /hansql-test/src/test/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 18 | 19 | 20 | 21 | %-4level %date{HH:mm:ss.SSS} %msg%n 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /hansql-test/src/test/resources/test.csvh: -------------------------------------------------------------------------------- 1 | person_id, salary, salary1, salary2, salary3, salary4 2 | 1, 1000000000, 1000000000, 1000000000, 1000000000, 1000000000 3 | 2, 1000000000, 1000000000, 1000000000, 1000000000, 1000000000 4 | 3, 1000000000, 1000000000, 1000000000, 1000000000, 1000000000 5 | 4, 1000000000, 1000000000, 1000000000, 1000000000, 1000000000 6 | 7 | -------------------------------------------------------------------------------- /hansql-vector/src/main/codegen/config.fmpp: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http:# www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | data: { 18 | # TODO: Rename to ~valueVectorModesAndTypes for clarity. 19 | vv: tdd(../data/ValueVectorTypes.tdd), 20 | 21 | } 22 | freemarkerLinks: { 23 | includes: includes/ 24 | } 25 | -------------------------------------------------------------------------------- /hansql-vector/src/main/codegen/includes/license.ftl: -------------------------------------------------------------------------------- 1 | <#-- 2 | 3 | Licensed to the Apache Software Foundation (ASF) under one 4 | or more contributor license agreements. See the NOTICE file 5 | distributed with this work for additional information 6 | regarding copyright ownership. The ASF licenses this file 7 | to you under the Apache License, Version 2.0 (the 8 | "License"); you may not use this file except in compliance 9 | with the License. You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | 19 | --> 20 | -------------------------------------------------------------------------------- /hansql-vector/src/main/java/org/lealone/hansql/exec/expr/holders/ComplexHolder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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.lealone.hansql.exec.expr.holders; 19 | 20 | import org.lealone.hansql.exec.vector.complex.reader.FieldReader; 21 | 22 | public class ComplexHolder implements ValueHolder { 23 | public FieldReader reader; 24 | public int isSet; 25 | } 26 | -------------------------------------------------------------------------------- /hansql-vector/src/main/java/org/lealone/hansql/exec/record/TransferPair.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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.lealone.hansql.exec.record; 19 | 20 | import org.lealone.hansql.exec.vector.ValueVector; 21 | 22 | public interface TransferPair { 23 | public void transfer(); 24 | public void splitAndTransfer(int startIndex, int length); 25 | public ValueVector getTo(); 26 | public void copyValueSafe(int from, int to); 27 | } 28 | -------------------------------------------------------------------------------- /hansql-vector/src/main/java/org/lealone/hansql/exec/util/CallBack.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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.lealone.hansql.exec.util; 19 | 20 | 21 | public interface CallBack { 22 | public void doWork(); 23 | } 24 | -------------------------------------------------------------------------------- /hansql-vector/src/main/java/org/lealone/hansql/exec/vector/UntypedReader.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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.lealone.hansql.exec.vector; 19 | 20 | import org.lealone.hansql.exec.vector.complex.reader.BaseReader; 21 | 22 | public interface UntypedReader extends BaseReader { 23 | 24 | boolean isSet(); 25 | int size(); 26 | void read(UntypedNullHolder holder); 27 | void read(int arrayIndex, UntypedNullHolder holder); 28 | } 29 | -------------------------------------------------------------------------------- /hansql-vector/src/main/java/org/lealone/hansql/exec/vector/accessor/ObjectType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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.lealone.hansql.exec.vector.accessor; 19 | 20 | /** 21 | * Type of writer. Follows the JSON-style model, with the 22 | * most abstract object types being a scalar (primitive), 23 | * tuple (map or row) or an array (repeated type.) 24 | */ 25 | 26 | public enum ObjectType { 27 | SCALAR, TUPLE, ARRAY, VARIANT 28 | } 29 | -------------------------------------------------------------------------------- /hansql-vector/src/main/java/org/lealone/hansql/exec/vector/accessor/reader/ElementReaderIndex.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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.lealone.hansql.exec.vector.accessor.reader; 19 | 20 | public interface ElementReaderIndex { 21 | int batchIndex(); 22 | int size(); 23 | int vectorIndex(int posn); 24 | } 25 | -------------------------------------------------------------------------------- /hansql-vector/src/main/java/org/lealone/hansql/exec/vector/complex/Positionable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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.lealone.hansql.exec.vector.complex; 19 | 20 | public interface Positionable { 21 | public void setPosition(int index); 22 | } 23 | -------------------------------------------------------------------------------- /hansql-vector/src/main/java/org/lealone/hansql/exec/vector/complex/VectorWithOrdinal.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * 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.lealone.hansql.exec.vector.complex; 19 | 20 | import org.lealone.hansql.exec.vector.ValueVector; 21 | 22 | public class VectorWithOrdinal { 23 | public final ValueVector vector; 24 | public final int ordinal; 25 | 26 | public VectorWithOrdinal(ValueVector v, int ordinal) { 27 | this.vector = v; 28 | this.ordinal = ordinal; 29 | } 30 | } --------------------------------------------------------------------------------