├── .gitattributes ├── .gitignore ├── .gitmodules ├── .travis.yml ├── BUILDING.md ├── CMakeLists.txt ├── CREDITS.md ├── DEV_README.md ├── DISCLAIMER ├── Doxyfile ├── GENERATOR_FUNCTIONS.md ├── HISTORY.md ├── LICENSE ├── NOTICE ├── README.md ├── RETIRED.md ├── WORKING_WITH_AN_IDE.md ├── autofix_cmakelists.py ├── build ├── profile_build.sh └── vagrant │ ├── README.md │ ├── debian-jessie-amd64 │ └── Vagrantfile │ ├── freebsd-10.2-amd64 │ └── Vagrantfile │ └── ubuntu-precise-amd64 │ └── Vagrantfile ├── catalog ├── CMakeLists.txt ├── Catalog.cpp ├── Catalog.hpp ├── Catalog.proto ├── CatalogAttribute.cpp ├── CatalogAttribute.hpp ├── CatalogConfig.h.in ├── CatalogDatabase.cpp ├── CatalogDatabase.hpp ├── CatalogDatabaseCache.cpp ├── CatalogDatabaseCache.hpp ├── CatalogDatabaseLite.hpp ├── CatalogErrors.hpp ├── CatalogModule.hpp ├── CatalogRelation.cpp ├── CatalogRelation.hpp ├── CatalogRelationSchema.cpp ├── CatalogRelationSchema.hpp ├── CatalogRelationStatistics.cpp ├── CatalogRelationStatistics.hpp ├── CatalogTypedefs.hpp ├── IndexScheme.cpp ├── IndexScheme.hpp ├── NUMAPlacementScheme.cpp ├── NUMAPlacementScheme.hpp ├── PartitionScheme.cpp ├── PartitionScheme.hpp ├── PartitionSchemeHeader.cpp ├── PartitionSchemeHeader.hpp └── tests │ ├── CatalogRelationStatistics_unittest.cpp │ ├── Catalog_unittest.cpp │ ├── NUMAPlacementScheme_unittest.cpp │ └── PartitionScheme_unittest.cpp ├── cli ├── CMakeLists.txt ├── CliConfig.h.in ├── CliModule.hpp ├── CommandExecutor.cpp ├── CommandExecutor.hpp ├── CommandExecutorUtil.cpp ├── CommandExecutorUtil.hpp ├── Constants.hpp ├── DefaultsConfigurator.cpp ├── DefaultsConfigurator.hpp ├── DropRelation.cpp ├── DropRelation.hpp ├── Flags.cpp ├── Flags.hpp ├── IOInterface.hpp ├── InputParserUtil.cpp ├── InputParserUtil.hpp ├── LineReader.cpp ├── LineReader.hpp ├── LineReaderBuffered.cpp ├── LineReaderBuffered.hpp ├── LineReaderDumb.cpp ├── LineReaderDumb.hpp ├── LineReaderLineNoise.cpp ├── LineReaderLineNoise.hpp ├── LocalIO.hpp ├── NetworkCli.proto ├── NetworkCliClient.hpp ├── NetworkCliClientMain.cpp ├── NetworkIO.cpp ├── NetworkIO.hpp ├── PrintToScreen.cpp ├── PrintToScreen.hpp ├── QuickstepCli.cpp ├── distributed │ ├── CMakeLists.txt │ ├── Cli.cpp │ ├── Cli.hpp │ ├── CliDistributedModule.hpp │ ├── Conductor.cpp │ ├── Conductor.hpp │ ├── Executor.cpp │ ├── Executor.hpp │ ├── QuickstepDistributedCli.cpp │ ├── Role.cpp │ └── Role.hpp └── tests │ ├── CMakeLists.txt │ ├── CommandExecutorTest.cpp │ ├── CommandExecutorTestRunner.cpp │ ├── CommandExecutorTestRunner.hpp │ ├── DistributedCommandExecutorTest.cpp │ ├── DistributedCommandExecutorTestRunner.cpp │ ├── DistributedCommandExecutorTestRunner.hpp │ ├── LineReaderBuffered_unittest.cpp │ ├── NetworkIO_unittest.cpp │ └── command_executor │ ├── Analyze.test │ ├── CMakeLists.txt │ ├── D.test │ └── Dt.test ├── cmake ├── FindGSasl.cmake ├── FindKerberos.cmake ├── FindLibNuma.cmake ├── FindLibhdfs3.cmake └── QsProtobufGenerateCpp.cmake ├── compression ├── CMakeLists.txt ├── CompressionDictionary.cpp ├── CompressionDictionary.hpp ├── CompressionDictionaryBuilder.cpp ├── CompressionDictionaryBuilder.hpp ├── CompressionDictionaryLite.cpp ├── CompressionDictionaryLite.hpp ├── CompressionModule.hpp └── tests │ └── CompressionDictionary_unittest.cpp ├── cyclic_dependency.py ├── empty_src.cpp ├── expressions ├── CMakeLists.txt ├── Expression.hpp ├── ExpressionFactories.cpp ├── ExpressionFactories.hpp ├── Expressions.proto ├── ExpressionsModule.hpp ├── aggregation │ ├── AggregateFunction.cpp │ ├── AggregateFunction.hpp │ ├── AggregateFunction.proto │ ├── AggregateFunctionAvg.cpp │ ├── AggregateFunctionAvg.hpp │ ├── AggregateFunctionCount.cpp │ ├── AggregateFunctionCount.hpp │ ├── AggregateFunctionFactory.cpp │ ├── AggregateFunctionFactory.hpp │ ├── AggregateFunctionMax.cpp │ ├── AggregateFunctionMax.hpp │ ├── AggregateFunctionMin.cpp │ ├── AggregateFunctionMin.hpp │ ├── AggregateFunctionSum.cpp │ ├── AggregateFunctionSum.hpp │ ├── AggregationConcreteHandle.cpp │ ├── AggregationConcreteHandle.hpp │ ├── AggregationHandle.hpp │ ├── AggregationHandleAvg.cpp │ ├── AggregationHandleAvg.hpp │ ├── AggregationHandleCount.cpp │ ├── AggregationHandleCount.hpp │ ├── AggregationHandleMax.cpp │ ├── AggregationHandleMax.hpp │ ├── AggregationHandleMin.cpp │ ├── AggregationHandleMin.hpp │ ├── AggregationHandleSum.cpp │ ├── AggregationHandleSum.hpp │ ├── AggregationID.hpp │ ├── CMakeLists.txt │ └── tests │ │ ├── AggregationHandleAvg_unittest.cpp │ │ ├── AggregationHandleCount_unittest.cpp │ │ ├── AggregationHandleMax_unittest.cpp │ │ ├── AggregationHandleMin_unittest.cpp │ │ └── AggregationHandleSum_unittest.cpp ├── predicate │ ├── CMakeLists.txt │ ├── ComparisonPredicate.cpp │ ├── ComparisonPredicate.hpp │ ├── ConjunctionPredicate.cpp │ ├── ConjunctionPredicate.hpp │ ├── DisjunctionPredicate.cpp │ ├── DisjunctionPredicate.hpp │ ├── NegationPredicate.cpp │ ├── NegationPredicate.hpp │ ├── Predicate.cpp │ ├── Predicate.hpp │ ├── PredicateCost.hpp │ ├── PredicateWithList.cpp │ ├── PredicateWithList.hpp │ ├── TrivialPredicates.hpp │ └── tests │ │ └── Predicate_unittest.cpp ├── scalar │ ├── CMakeLists.txt │ ├── Scalar.cpp │ ├── Scalar.hpp │ ├── ScalarAttribute.cpp │ ├── ScalarAttribute.hpp │ ├── ScalarBinaryExpression.cpp │ ├── ScalarBinaryExpression.hpp │ ├── ScalarCaseExpression.cpp │ ├── ScalarCaseExpression.hpp │ ├── ScalarLiteral.cpp │ ├── ScalarLiteral.hpp │ ├── ScalarSharedExpression.cpp │ ├── ScalarSharedExpression.hpp │ ├── ScalarUnaryExpression.cpp │ ├── ScalarUnaryExpression.hpp │ └── tests │ │ ├── ScalarCaseExpression_unittest.cpp │ │ └── Scalar_unittest.cpp ├── table_generator │ ├── CMakeLists.txt │ ├── GenerateSeries.hpp │ ├── GenerateSeriesHandle.hpp │ ├── GeneratorFunction.hpp │ ├── GeneratorFunction.proto │ ├── GeneratorFunctionFactory.cpp │ ├── GeneratorFunctionFactory.hpp │ └── GeneratorFunctionHandle.hpp └── window_aggregation │ ├── CMakeLists.txt │ ├── WindowAggregateFunction.cpp │ ├── WindowAggregateFunction.hpp │ ├── WindowAggregateFunction.proto │ ├── WindowAggregateFunctionAvg.cpp │ ├── WindowAggregateFunctionAvg.hpp │ ├── WindowAggregateFunctionCount.cpp │ ├── WindowAggregateFunctionCount.hpp │ ├── WindowAggregateFunctionFactory.cpp │ ├── WindowAggregateFunctionFactory.hpp │ ├── WindowAggregateFunctionMax.cpp │ ├── WindowAggregateFunctionMax.hpp │ ├── WindowAggregateFunctionMin.cpp │ ├── WindowAggregateFunctionMin.hpp │ ├── WindowAggregateFunctionSum.cpp │ ├── WindowAggregateFunctionSum.hpp │ ├── WindowAggregationHandle.cpp │ ├── WindowAggregationHandle.hpp │ ├── WindowAggregationHandleAvg.cpp │ ├── WindowAggregationHandleAvg.hpp │ ├── WindowAggregationID.hpp │ └── tests │ └── WindowAggregationHandleAvg_unittest.cpp ├── lint_everything.py ├── parser ├── CMakeLists.txt ├── ParseAssignment.hpp ├── ParseAttributeDefinition.cpp ├── ParseAttributeDefinition.hpp ├── ParseBasicExpressions.cpp ├── ParseBasicExpressions.hpp ├── ParseBlockProperties.cpp ├── ParseBlockProperties.hpp ├── ParseCaseExpressions.cpp ├── ParseCaseExpressions.hpp ├── ParseExpression.hpp ├── ParseGeneratorTableReference.cpp ├── ParseGeneratorTableReference.hpp ├── ParseGroupBy.cpp ├── ParseGroupBy.hpp ├── ParseHaving.cpp ├── ParseHaving.hpp ├── ParseIndexProperties.cpp ├── ParseIndexProperties.hpp ├── ParseJoinedTableReference.cpp ├── ParseJoinedTableReference.hpp ├── ParseKeyValue.hpp ├── ParseLimit.cpp ├── ParseLimit.hpp ├── ParseLiteralValue.cpp ├── ParseLiteralValue.hpp ├── ParseOrderBy.cpp ├── ParseOrderBy.hpp ├── ParsePartitionClause.hpp ├── ParsePredicate.cpp ├── ParsePredicate.hpp ├── ParsePredicateExists.hpp ├── ParsePredicateInTableQuery.hpp ├── ParsePriority.hpp ├── ParseSample.cpp ├── ParseSample.hpp ├── ParseSelect.hpp ├── ParseSelectionClause.cpp ├── ParseSelectionClause.hpp ├── ParseSetOperation.hpp ├── ParseSimpleTableReference.cpp ├── ParseSimpleTableReference.hpp ├── ParseStatement.hpp ├── ParseString.cpp ├── ParseString.hpp ├── ParseSubqueryExpression.cpp ├── ParseSubqueryExpression.hpp ├── ParseSubqueryTableReference.cpp ├── ParseSubqueryTableReference.hpp ├── ParseTableReference.cpp ├── ParseTableReference.hpp ├── ParseTreeNode.hpp ├── ParseWindow.hpp ├── ParserModule.hpp ├── ParserUtil.cpp ├── ParserUtil.hpp ├── SqlLexer.lpp ├── SqlParser.ypp ├── SqlParserWrapper.cpp ├── SqlParserWrapper.hpp ├── preprocessed │ ├── SqlLexer_gen.cpp │ ├── SqlLexer_gen.hpp │ ├── SqlParser_gen.cpp │ ├── SqlParser_gen.hpp │ └── genfiles.sh └── tests │ ├── Aggregate.test │ ├── Alter.test │ ├── CMakeLists.txt │ ├── Copy.test │ ├── Create.test │ ├── Delete.test │ ├── Drop.test │ ├── Index.test │ ├── Insert.test │ ├── Join.test │ ├── ParserTest.cpp │ ├── Select.test │ ├── SetOperation.test │ ├── TPCH.test │ └── Update.test ├── query_execution ├── AdmitRequestMessage.hpp ├── BlockLocator.cpp ├── BlockLocator.hpp ├── BlockLocatorUtil.cpp ├── BlockLocatorUtil.hpp ├── CMakeLists.txt ├── ExecutionStats.hpp ├── ForemanBase.hpp ├── ForemanDistributed.cpp ├── ForemanDistributed.hpp ├── ForemanSingleNode.cpp ├── ForemanSingleNode.hpp ├── PolicyEnforcerBase.cpp ├── PolicyEnforcerBase.hpp ├── PolicyEnforcerDistributed.cpp ├── PolicyEnforcerDistributed.hpp ├── PolicyEnforcerSingleNode.cpp ├── PolicyEnforcerSingleNode.hpp ├── ProbabilityStore.hpp ├── QueryContext.cpp ├── QueryContext.hpp ├── QueryContext.proto ├── QueryExecutionMessages.proto ├── QueryExecutionModule.hpp ├── QueryExecutionState.hpp ├── QueryExecutionTypedefs.hpp ├── QueryExecutionUtil.hpp ├── QueryManagerBase.cpp ├── QueryManagerBase.hpp ├── QueryManagerDistributed.cpp ├── QueryManagerDistributed.hpp ├── QueryManagerSingleNode.cpp ├── QueryManagerSingleNode.hpp ├── README.md ├── Shiftboss.cpp ├── Shiftboss.hpp ├── ShiftbossDirectory.hpp ├── WorkOrderProtosContainer.hpp ├── WorkOrderSelectionPolicy.hpp ├── WorkOrdersContainer.cpp ├── WorkOrdersContainer.hpp ├── Worker.cpp ├── Worker.hpp ├── WorkerDirectory.hpp ├── WorkerMessage.hpp ├── WorkerSelectionPolicy.hpp └── tests │ ├── BlockLocator_unittest.cpp │ ├── ProbabilityStore_unittest.cpp │ ├── QueryManagerSingleNode_unittest.cpp │ ├── WorkOrdersContainer_unittest.cpp │ ├── WorkerDirectory_unittest.cpp │ └── WorkerSelectionPolicy_unittest.cpp ├── query_optimizer ├── CMakeLists.txt ├── ExecutionGenerator.cpp ├── ExecutionGenerator.hpp ├── LIPFilterGenerator.cpp ├── LIPFilterGenerator.hpp ├── LogicalGenerator.cpp ├── LogicalGenerator.hpp ├── LogicalToPhysicalMapper.hpp ├── Optimizer.cpp ├── Optimizer.hpp ├── OptimizerContext.cpp ├── OptimizerContext.hpp ├── OptimizerTree.hpp ├── PhysicalGenerator.cpp ├── PhysicalGenerator.hpp ├── QueryHandle.hpp ├── QueryOptimizerConfig.h.in ├── QueryOptimizerModule.hpp ├── QueryPlan.hpp ├── QueryProcessor.cpp ├── QueryProcessor.hpp ├── Validator.hpp ├── cost_model │ ├── CMakeLists.txt │ ├── CostModel.hpp │ ├── CostModelModule.hpp │ ├── SimpleCostModel.cpp │ ├── SimpleCostModel.hpp │ ├── StarSchemaSimpleCostModel.cpp │ └── StarSchemaSimpleCostModel.hpp ├── expressions │ ├── AggregateFunction.cpp │ ├── AggregateFunction.hpp │ ├── Alias.cpp │ ├── Alias.hpp │ ├── AttributeReference.cpp │ ├── AttributeReference.hpp │ ├── BinaryExpression.cpp │ ├── BinaryExpression.hpp │ ├── CMakeLists.txt │ ├── Cast.cpp │ ├── Cast.hpp │ ├── CommonSubexpression.cpp │ ├── CommonSubexpression.hpp │ ├── ComparisonExpression.cpp │ ├── ComparisonExpression.hpp │ ├── Exists.cpp │ ├── Exists.hpp │ ├── ExprId.hpp │ ├── Expression.hpp │ ├── ExpressionType.hpp │ ├── ExpressionUtil.cpp │ ├── ExpressionUtil.hpp │ ├── InTableQuery.cpp │ ├── InTableQuery.hpp │ ├── InValueList.cpp │ ├── InValueList.hpp │ ├── LogicalAnd.cpp │ ├── LogicalAnd.hpp │ ├── LogicalNot.cpp │ ├── LogicalNot.hpp │ ├── LogicalOr.cpp │ ├── LogicalOr.hpp │ ├── NamedExpression.cpp │ ├── NamedExpression.hpp │ ├── OptimizerExpressionsModule.hpp │ ├── PatternMatcher.hpp │ ├── Predicate.hpp │ ├── PredicateLiteral.cpp │ ├── PredicateLiteral.hpp │ ├── Scalar.hpp │ ├── ScalarLiteral.cpp │ ├── ScalarLiteral.hpp │ ├── SearchedCase.cpp │ ├── SearchedCase.hpp │ ├── SimpleCase.cpp │ ├── SimpleCase.hpp │ ├── SubqueryExpression.cpp │ ├── SubqueryExpression.hpp │ ├── UnaryExpression.cpp │ ├── UnaryExpression.hpp │ ├── WindowAggregateFunction.cpp │ └── WindowAggregateFunction.hpp ├── logical │ ├── Aggregate.cpp │ ├── Aggregate.hpp │ ├── BinaryJoin.cpp │ ├── BinaryJoin.hpp │ ├── CMakeLists.txt │ ├── CopyFrom.cpp │ ├── CopyFrom.hpp │ ├── CopyTo.cpp │ ├── CopyTo.hpp │ ├── CreateIndex.cpp │ ├── CreateIndex.hpp │ ├── CreateTable.cpp │ ├── CreateTable.hpp │ ├── DeleteTuples.cpp │ ├── DeleteTuples.hpp │ ├── DropTable.cpp │ ├── DropTable.hpp │ ├── Filter.cpp │ ├── Filter.hpp │ ├── HashJoin.hpp │ ├── InsertSelection.cpp │ ├── InsertSelection.hpp │ ├── InsertTuple.cpp │ ├── InsertTuple.hpp │ ├── Join.hpp │ ├── Logical.hpp │ ├── LogicalType.hpp │ ├── MultiwayCartesianJoin.cpp │ ├── MultiwayCartesianJoin.hpp │ ├── NestedLoopsJoin.hpp │ ├── OptimizerLogicalModule.hpp │ ├── PatternMatcher.hpp │ ├── Project.cpp │ ├── Project.hpp │ ├── Sample.cpp │ ├── Sample.hpp │ ├── SetOperation.hpp │ ├── SharedSubplanReference.cpp │ ├── SharedSubplanReference.hpp │ ├── Sort.cpp │ ├── Sort.hpp │ ├── TableGenerator.hpp │ ├── TableReference.cpp │ ├── TableReference.hpp │ ├── TopLevelPlan.cpp │ ├── TopLevelPlan.hpp │ ├── UpdateTable.cpp │ ├── UpdateTable.hpp │ ├── WindowAggregate.cpp │ └── WindowAggregate.hpp ├── physical │ ├── Aggregate.cpp │ ├── Aggregate.hpp │ ├── BinaryJoin.cpp │ ├── BinaryJoin.hpp │ ├── CMakeLists.txt │ ├── CopyFrom.cpp │ ├── CopyFrom.hpp │ ├── CopyTo.cpp │ ├── CopyTo.hpp │ ├── CreateIndex.cpp │ ├── CreateIndex.hpp │ ├── CreateTable.cpp │ ├── CreateTable.hpp │ ├── CrossReferenceCoalesceAggregate.cpp │ ├── CrossReferenceCoalesceAggregate.hpp │ ├── DeleteTuples.cpp │ ├── DeleteTuples.hpp │ ├── DropTable.cpp │ ├── DropTable.hpp │ ├── FilterJoin.cpp │ ├── FilterJoin.hpp │ ├── HashJoin.cpp │ ├── HashJoin.hpp │ ├── InsertSelection.cpp │ ├── InsertSelection.hpp │ ├── InsertTuple.cpp │ ├── InsertTuple.hpp │ ├── Join.hpp │ ├── LIPFilterConfiguration.hpp │ ├── NestedLoopsJoin.cpp │ ├── NestedLoopsJoin.hpp │ ├── OptimizerPhysicalModule.hpp │ ├── PartitionSchemeHeader.cpp │ ├── PartitionSchemeHeader.hpp │ ├── PatternMatcher.hpp │ ├── Physical.hpp │ ├── PhysicalType.hpp │ ├── Sample.cpp │ ├── Sample.hpp │ ├── Selection.cpp │ ├── Selection.hpp │ ├── SharedSubplanReference.cpp │ ├── SharedSubplanReference.hpp │ ├── Sort.cpp │ ├── Sort.hpp │ ├── TableGenerator.hpp │ ├── TableReference.cpp │ ├── TableReference.hpp │ ├── TopLevelPlan.cpp │ ├── TopLevelPlan.hpp │ ├── UnionAll.hpp │ ├── UpdateTable.cpp │ ├── UpdateTable.hpp │ ├── WindowAggregate.cpp │ └── WindowAggregate.hpp ├── resolver │ ├── CMakeLists.txt │ ├── NameResolver.cpp │ ├── NameResolver.hpp │ ├── QueryResolverModule.hpp │ ├── Resolver.cpp │ └── Resolver.hpp ├── rules │ ├── AttachLIPFilters.cpp │ ├── AttachLIPFilters.hpp │ ├── BottomUpRule.hpp │ ├── CMakeLists.txt │ ├── CollapseProject.cpp │ ├── CollapseProject.hpp │ ├── CollapseSelection.cpp │ ├── CollapseSelection.hpp │ ├── EliminateEmptyNode.cpp │ ├── EliminateEmptyNode.hpp │ ├── ExtractCommonSubexpression.cpp │ ├── ExtractCommonSubexpression.hpp │ ├── FuseAggregateJoin.cpp │ ├── FuseAggregateJoin.hpp │ ├── FuseHashSelect.cpp │ ├── FuseHashSelect.hpp │ ├── GenerateJoins.cpp │ ├── GenerateJoins.hpp │ ├── InjectJoinFilters.cpp │ ├── InjectJoinFilters.hpp │ ├── OptimizerRulesModule.hpp │ ├── Partition.cpp │ ├── Partition.hpp │ ├── PruneColumns.cpp │ ├── PruneColumns.hpp │ ├── PushDownFilter.cpp │ ├── PushDownFilter.hpp │ ├── PushDownLowCostDisjunctivePredicate.cpp │ ├── PushDownLowCostDisjunctivePredicate.hpp │ ├── PushDownSemiAntiJoin.cpp │ ├── PushDownSemiAntiJoin.hpp │ ├── ReduceGroupByAttributes.cpp │ ├── ReduceGroupByAttributes.hpp │ ├── ReferencedBaseRelations.cpp │ ├── ReferencedBaseRelations.hpp │ ├── ReorderColumns.cpp │ ├── ReorderColumns.hpp │ ├── ReuseAggregateExpressions.cpp │ ├── ReuseAggregateExpressions.hpp │ ├── Rule.hpp │ ├── RuleHelper.cpp │ ├── RuleHelper.hpp │ ├── StarSchemaHashJoinOrderOptimization.cpp │ ├── StarSchemaHashJoinOrderOptimization.hpp │ ├── SwapProbeBuild.cpp │ ├── SwapProbeBuild.hpp │ ├── TopDownRule.hpp │ ├── UnnestSubqueries.cpp │ ├── UnnestSubqueries.hpp │ ├── UpdateExpression.cpp │ ├── UpdateExpression.hpp │ └── tests │ │ ├── CMakeLists.txt │ │ ├── CollapseProject_unittest.cpp │ │ ├── ExpressionRuleTest.hpp │ │ ├── GenerateJoins_unittest.cpp │ │ ├── LogicalRuleTest.hpp │ │ ├── Partition_unittest.cpp │ │ ├── PhysicalRuleTest.hpp │ │ ├── PruneColumns_unittest.cpp │ │ ├── PushDownFilter_unittest.cpp │ │ ├── RuleTest.hpp │ │ └── UpdateExpression_unittest.cpp ├── strategy │ ├── Aggregate.cpp │ ├── Aggregate.hpp │ ├── CMakeLists.txt │ ├── Join.cpp │ ├── Join.hpp │ ├── OneToOne.cpp │ ├── OneToOne.hpp │ ├── OptimizerStrategyModule.hpp │ ├── Selection.cpp │ ├── Selection.hpp │ ├── Strategy.hpp │ └── tests │ │ ├── Aggregate_unittest.cpp │ │ ├── CMakeLists.txt │ │ ├── Join_unittest.cpp │ │ ├── OneToOne_unittest.cpp │ │ ├── Selection_unittest.cpp │ │ └── StrategyTest.hpp └── tests │ ├── CMakeLists.txt │ ├── DistributedExecutionGeneratorTest.cpp │ ├── DistributedExecutionGeneratorTestRunner.cpp │ ├── DistributedExecutionGeneratorTestRunner.hpp │ ├── ExecutionGeneratorTest.cpp │ ├── ExecutionGeneratorTestRunner.cpp │ ├── ExecutionGeneratorTestRunner.hpp │ ├── OptimizerTest.cpp │ ├── OptimizerTest.hpp │ ├── OptimizerTextTest.cpp │ ├── OptimizerTextTestRunner.cpp │ ├── OptimizerTextTestRunner.hpp │ ├── TestDatabaseLoader.cpp │ ├── TestDatabaseLoader.hpp │ ├── execution_generator │ ├── CMakeLists.txt │ ├── CommonSubexpression.test │ ├── Copy.test │ ├── Create.test │ ├── Delete.test │ ├── Distinct.test │ ├── Drop.test │ ├── Index.test │ ├── Insert.test │ ├── Join.test │ ├── Partition.test │ ├── Select.test │ ├── StringPatternMatching.test │ ├── TableGenerator.test │ ├── Union.test │ └── Update.test │ ├── logical_generator │ ├── CMakeLists.txt │ ├── Create.test │ ├── Index.test │ ├── Join.test │ └── Select.test │ ├── physical_generator │ ├── CMakeLists.txt │ ├── CommonSubexpression.test │ ├── Copy.test │ ├── Create.test │ ├── Delete.test │ ├── Drop.test │ ├── Index.test │ ├── Insert.test │ ├── Join.test │ ├── Select.test │ └── Update.test │ └── resolver │ ├── Aggregate.test │ ├── CMakeLists.txt │ ├── Copy.test │ ├── Create.test │ ├── Delete.test │ ├── Drop.test │ ├── Index.test │ ├── Insert.test │ ├── Join.test │ ├── Select.test │ ├── SetOperation.test │ └── Update.test ├── relational_operators ├── AggregationOperator.cpp ├── AggregationOperator.hpp ├── BuildAggregationExistenceMapOperator.cpp ├── BuildAggregationExistenceMapOperator.hpp ├── BuildHashOperator.cpp ├── BuildHashOperator.hpp ├── BuildLIPFilterOperator.cpp ├── BuildLIPFilterOperator.hpp ├── CMakeLists.txt ├── CreateIndexOperator.hpp ├── CreateTableOperator.hpp ├── DeleteOperator.cpp ├── DeleteOperator.hpp ├── DestroyAggregationStateOperator.cpp ├── DestroyAggregationStateOperator.hpp ├── DestroyHashOperator.cpp ├── DestroyHashOperator.hpp ├── DropTableOperator.cpp ├── DropTableOperator.hpp ├── FinalizeAggregationOperator.cpp ├── FinalizeAggregationOperator.hpp ├── HashJoinOperator.cpp ├── HashJoinOperator.hpp ├── InitializeAggregationOperator.cpp ├── InitializeAggregationOperator.hpp ├── InsertOperator.cpp ├── InsertOperator.hpp ├── NestedLoopsJoinOperator.cpp ├── NestedLoopsJoinOperator.hpp ├── RebuildWorkOrder.hpp ├── RelationalOperator.hpp ├── RelationalOperatorsConfig.h.in ├── RelationalOperatorsModule.hpp ├── SampleOperator.cpp ├── SampleOperator.hpp ├── SaveBlocksOperator.cpp ├── SaveBlocksOperator.hpp ├── SelectOperator.cpp ├── SelectOperator.hpp ├── SortMergeRunOperator.cpp ├── SortMergeRunOperator.hpp ├── SortMergeRunOperator.proto ├── SortMergeRunOperatorHelpers.cpp ├── SortMergeRunOperatorHelpers.hpp ├── SortRunGenerationOperator.cpp ├── SortRunGenerationOperator.hpp ├── TableExportOperator.cpp ├── TableExportOperator.hpp ├── TableGeneratorOperator.cpp ├── TableGeneratorOperator.hpp ├── TextScanOperator.cpp ├── TextScanOperator.hpp ├── UnionAllOperator.cpp ├── UnionAllOperator.hpp ├── UpdateOperator.cpp ├── UpdateOperator.hpp ├── WindowAggregationOperator.cpp ├── WindowAggregationOperator.hpp ├── WorkOrder.hpp ├── WorkOrder.proto ├── WorkOrderFactory.cpp ├── WorkOrderFactory.hpp └── tests │ ├── AggregationOperator_unittest.cpp │ ├── HashJoinOperator_unittest.cpp │ ├── SortMergeRunOperator_unittest.cpp │ ├── SortRunGenerationOperator_unittest.cpp │ ├── TextScanOperator_unittest.cpp │ ├── text_scan_faulty_golden_output.txt │ ├── text_scan_faulty_input.txt │ ├── text_scan_golden_output.txt │ └── text_scan_input.txt ├── storage ├── AggregationOperationState.cpp ├── AggregationOperationState.hpp ├── AggregationOperationState.proto ├── BasicColumnStoreTupleStorageSubBlock.cpp ├── BasicColumnStoreTupleStorageSubBlock.hpp ├── BasicColumnStoreValueAccessor.hpp ├── BlockWire.proto ├── BloomFilterIndexSubBlock.cpp ├── BloomFilterIndexSubBlock.hpp ├── CMakeLists.txt ├── CSBTreeIndexSubBlock.cpp ├── CSBTreeIndexSubBlock.hpp ├── CollisionFreeVectorTable.cpp ├── CollisionFreeVectorTable.hpp ├── ColumnStoreUtil.cpp ├── ColumnStoreUtil.hpp ├── CompressedBlockBuilder.cpp ├── CompressedBlockBuilder.hpp ├── CompressedColumnStoreTupleStorageSubBlock.cpp ├── CompressedColumnStoreTupleStorageSubBlock.hpp ├── CompressedColumnStoreValueAccessor.hpp ├── CompressedPackedRowStoreTupleStorageSubBlock.cpp ├── CompressedPackedRowStoreTupleStorageSubBlock.hpp ├── CompressedPackedRowStoreValueAccessor.hpp ├── CompressedStoreUtil.cpp ├── CompressedStoreUtil.hpp ├── CompressedTupleStorageSubBlock.cpp ├── CompressedTupleStorageSubBlock.hpp ├── CountedReference.hpp ├── DataExchange.proto ├── DataExchangerAsync.cpp ├── DataExchangerAsync.hpp ├── DataProviderThread.cpp ├── DataProviderThread.hpp ├── EvictionPolicy.cpp ├── EvictionPolicy.hpp ├── FileManager.hpp ├── FileManagerHdfs.cpp ├── FileManagerHdfs.hpp ├── FileManagerLocal.hpp ├── FileManagerPosix.cpp ├── FileManagerPosix.hpp ├── FileManagerWindows.cpp ├── FileManagerWindows.hpp ├── Flags.cpp ├── Flags.hpp ├── HashTable.hpp ├── HashTable.proto ├── HashTableBase.hpp ├── HashTableFactory.cpp ├── HashTableFactory.hpp ├── HashTableKeyManager.hpp ├── HashTablePool.hpp ├── IndexSubBlock.hpp ├── IndexSubBlockDescriptionFactory.hpp ├── InsertDestination.cpp ├── InsertDestination.hpp ├── InsertDestination.proto ├── InsertDestinationInterface.hpp ├── LinearOpenAddressingHashTable.hpp ├── PackedPayloadHashTable.cpp ├── PackedPayloadHashTable.hpp ├── PartitionedHashTablePool.hpp ├── PreloaderThread.cpp ├── PreloaderThread.hpp ├── SMAIndexSubBlock.cpp ├── SMAIndexSubBlock.hpp ├── SeparateChainingHashTable.hpp ├── SimpleScalarSeparateChainingHashTable.cpp ├── SimpleScalarSeparateChainingHashTable.hpp ├── SplitRowStoreTupleStorageSubBlock.cpp ├── SplitRowStoreTupleStorageSubBlock.hpp ├── SplitRowStoreValueAccessor.hpp ├── StorageBlob.hpp ├── StorageBlock.cpp ├── StorageBlock.hpp ├── StorageBlockBase.hpp ├── StorageBlockInfo.cpp ├── StorageBlockInfo.hpp ├── StorageBlockLayout.cpp ├── StorageBlockLayout.hpp ├── StorageBlockLayout.proto ├── StorageConfig.h.in ├── StorageConstants.hpp ├── StorageErrors.cpp ├── StorageErrors.hpp ├── StorageManager.cpp ├── StorageManager.hpp ├── StorageModule.hpp ├── SubBlockTypeRegistry.cpp ├── SubBlockTypeRegistry.hpp ├── SubBlockTypeRegistryMacros.hpp ├── SubBlocksReference.hpp ├── ThreadPrivateCompactKeyHashTable.cpp ├── ThreadPrivateCompactKeyHashTable.hpp ├── TupleIdSequence.hpp ├── TupleReference.hpp ├── TupleStorageSubBlock.cpp ├── TupleStorageSubBlock.hpp ├── ValueAccessor.hpp ├── ValueAccessorMultiplexer.hpp ├── ValueAccessorUtil.hpp ├── WindowAggregationOperationState.cpp ├── WindowAggregationOperationState.hpp ├── WindowAggregationOperationState.proto └── tests │ ├── AggregationOperationState_unittest.cpp │ ├── BasicColumnStoreTupleStorageSubBlock_unittest.cpp │ ├── BloomFilterIndexSubBlock_unittest.cpp │ ├── CSBTreeIndexSubBlock_unittest.cpp │ ├── CSBTreePrettyPrinter.cpp │ ├── CSBTreePrettyPrinter.hpp │ ├── CompressedColumnStoreTupleStorageSubBlock_unittest.cpp │ ├── CompressedPackedRowStoreTupleStorageSubBlock_unittest.cpp │ ├── DataExchange_unittest.cpp │ ├── DataProviderThread_unittest.cpp │ ├── EvictionPolicy_unittest.cpp │ ├── FileManagerHdfs_unittest.cpp │ ├── FileManagerLocal_unittest.cpp │ ├── FileManager_unittest_common.hpp │ ├── HashTable_unittest_common.hpp │ ├── LinearOpenAddressingHashTable_unittest.cpp │ ├── MockTupleStorageSubBlock.hpp │ ├── SMAIndexSubBlock_unittest.cpp │ ├── SeparateChainingHashTable_unittest.cpp │ ├── SimpleScalarSeparateChainingHashTable_unittest.cpp │ ├── SplitRowStoreTupleStorageSubBlock_unittest.cpp │ ├── StorageBlockSort_unittest.cpp │ ├── StorageManager_unittest.cpp │ ├── StorageTestConfig.h.in │ ├── TupleStorePredicateUtil.hpp │ └── WindowAggregationOperationState_unittest.cpp ├── third_party ├── README.md ├── download_and_patch_prerequisites.sh ├── patches │ ├── benchmark │ │ └── CMakeLists.patch │ ├── gflags │ │ ├── CMakeLists.patch │ │ └── gflags_reporting.cc.patch │ ├── glog │ │ ├── glogCMakeLists.txt.patch │ │ └── utilities.cc.patch │ ├── linenoise │ │ ├── CMakeLists.txt │ │ ├── linenoise.c.patch │ │ └── linenoise.h.patch │ └── re2 │ │ └── re2CMake.patch ├── reset_third_party_dir.sh └── src │ ├── cpplint │ └── cpplint.py │ ├── farmhash │ ├── CMakeLists.txt │ ├── COPYING │ ├── NEWS │ ├── README │ ├── Understanding_Hash_Functions │ ├── farm-test.cc │ ├── farmhash.cc │ └── farmhash.h │ ├── iwyu │ ├── Darwin.imp │ ├── README.md │ ├── iwyu_helper.py │ └── sample_iwyu_conf.py │ ├── protobuf_cmake │ ├── CMakeLists.txt │ └── config_cmake.h.in │ └── tmb │ ├── .gitignore │ ├── CMakeLists.txt │ ├── README.md │ ├── benchmarks │ ├── CMakeLists.txt │ ├── include │ │ └── tmbbench │ │ │ ├── affinity.h │ │ │ ├── bus_setup.h │ │ │ ├── messages.h │ │ │ ├── receiver_thread.h │ │ │ ├── sender_thread.h │ │ │ └── thread.h │ └── src │ │ ├── affinity.cc │ │ ├── bus_setup.cc │ │ ├── oneway_throughput.cc │ │ ├── oneway_throughput_distributed.cc │ │ ├── oneway_throughput_distributed_coordinator.cc │ │ ├── oneway_throughput_numa.cc │ │ ├── receiver_thread.cc │ │ ├── reset_bus.cc │ │ ├── sender_thread.cc │ │ └── thread.cc │ ├── cmake │ ├── FindGrpc++.cmake │ ├── FindLevelDB.cmake │ ├── FindProtobuf3.cmake │ ├── FindSQLite3.cmake │ ├── FindVoltDB.cmake │ └── FindZookeeper.cmake │ ├── include │ └── tmb │ │ ├── address.h │ │ ├── cancellation_token.h │ │ ├── id_typedefs.h │ │ ├── internal │ │ ├── c_string_buffer.h │ │ ├── cache_info.h │ │ ├── container_pusher.h │ │ ├── crc32.h │ │ ├── heap_receiver_message_queue.h │ │ ├── iterator_adapter.h │ │ ├── leveldb_key_comparator.h │ │ ├── leveldb_keys.h │ │ ├── lock_free_garbage_collector.h │ │ ├── lock_free_stack.h │ │ ├── log_read_status.h │ │ ├── log_reader_base.h │ │ ├── log_reader_posix.h │ │ ├── log_reader_stdio.h │ │ ├── log_record_header.h │ │ ├── log_writer_base.h │ │ ├── log_writer_posix.h │ │ ├── log_writer_stdio.h │ │ ├── logging_constants.h │ │ ├── memory_based_message_bus.h │ │ ├── memory_mirror_cancellation_set.h │ │ ├── memory_mirror_delete_batch.h │ │ ├── message_metadata.h │ │ ├── native_transaction_log.h │ │ ├── net_memory_container_pusher.h │ │ ├── net_message_removal_interface.h │ │ ├── net_service_impl.h │ │ ├── persistent_bus_state_interface.h │ │ ├── queued_message.h │ │ ├── rcu.h │ │ ├── shared_bool.h │ │ ├── sqlite_connection.h │ │ ├── sqlite_connection_pool.h │ │ ├── threadsafe_set.h │ │ ├── tree_receiver_message_queue.h │ │ ├── voltdb_connection_pool.h │ │ ├── voltdb_procedure_factory.h │ │ ├── voltdb_procedure_warehouse.h │ │ ├── zookeeper_format.h │ │ ├── zookeeper_receiver_context.h │ │ └── zookeeper_transaction_batch.h │ │ ├── leveldb_message_bus.h │ │ ├── memory_mirror_message_bus.h │ │ ├── message_bus.h │ │ ├── message_style.h │ │ ├── native_logging_message_bus.h │ │ ├── native_net_client_message_bus.h │ │ ├── priority.h │ │ ├── pure_memory_message_bus.h │ │ ├── sqlite_message_bus.h │ │ ├── tagged_message.h │ │ ├── voltdb_message_bus.h │ │ └── zookeeper_message_bus.h │ ├── src │ ├── crc32.cc │ ├── heap_receiver_message_queue.cc │ ├── java │ │ ├── CancelMessages.java │ │ ├── ConnectClient.java │ │ ├── DeleteMessages.java │ │ ├── DeleteMessagesUnchecked.java │ │ ├── DisconnectClient.java │ │ ├── LoadState.java │ │ ├── Receive.java │ │ ├── ReceiveAndDelete.java │ │ ├── RegisterReceiver.java │ │ ├── RegisterSender.java │ │ ├── ResetBus.java │ │ ├── SendToAny.java │ │ ├── SendToExplicitReceivers.java │ │ ├── SendToExplicitReceiversUnchecked.java │ │ ├── SendToSingleExplicitReceiver.java │ │ └── SendToSingleExplicitReceiverUnchecked.java │ ├── leveldb_key_comparator.cc │ ├── leveldb_message_bus.cc │ ├── log_reader_posix.cc │ ├── log_reader_stdio.cc │ ├── log_writer_posix.cc │ ├── log_writer_stdio.cc │ ├── memory_based_message_bus.cc │ ├── memory_mirror_message_bus.cc │ ├── message_bus.cc │ ├── native_net_client_message_bus.cc │ ├── native_transaction_log.cc │ ├── net_service_impl.cc │ ├── proto │ │ └── tmb_net.proto │ ├── pure_memory_message_bus.cc │ ├── sql │ │ └── voltdb_schema.sql │ ├── sqlite_connection.cc │ ├── sqlite_message_bus.cc │ ├── tmb_net_server.cc │ ├── tree_receiver_message_queue.cc │ ├── voltdb_connection_pool.cc │ ├── voltdb_message_bus.cc │ ├── voltdb_procedure_factory.cc │ ├── zookeeper_message_bus.cc │ └── zookeeper_transaction_batch.cc │ └── tests │ ├── leveldb_message_bus_async_unittest.cc │ ├── leveldb_message_bus_unittest.cc │ ├── memory_mirror_message_bus_with_leveldb_unittest.cc │ ├── memory_mirror_message_bus_with_sqlite_unittest.cc │ ├── memory_mirror_message_bus_with_voltdb_unittest.cc │ ├── memory_mirror_message_bus_with_zookeeper_unittest.cc │ ├── message_bus_unittest_common.h │ ├── native_logging_message_bus_async_unittest.cc │ ├── native_logging_message_bus_unittest.cc │ ├── native_net_client_message_bus_unittest.cc │ ├── pure_memory_message_bus_unittest.cc │ ├── rcu_unittest.cc │ ├── sqlite_message_bus_unittest.cc │ ├── voltdb_message_bus_unittest.cc │ └── zookeeper_message_bus_unittest.cc ├── threading ├── CMakeLists.txt ├── ConditionVariable.cpp ├── ConditionVariable.hpp ├── Mutex.cpp ├── Mutex.hpp ├── SharedMutex.hpp ├── SpinMutex.hpp ├── SpinSharedMutex.hpp ├── Thread.cpp ├── Thread.hpp ├── ThreadIDBasedMap.hpp ├── ThreadUtil.hpp ├── ThreadingConfig.h.in ├── ThreadingModule.hpp ├── WinThreadsAPI.hpp ├── cpp11 │ ├── ConditionVariable.hpp │ ├── Mutex.hpp │ ├── SharedMutex.hpp │ ├── Thread.hpp │ ├── cpp14 │ │ └── SharedMutex.hpp │ └── cpp17 │ │ └── SharedMutex.hpp ├── posix │ ├── ConditionVariable.hpp │ ├── Mutex.hpp │ ├── SharedMutex.hpp │ └── Thread.hpp ├── tests │ ├── Mutex_unittest.cpp │ └── SharedMutex_unittest.cpp └── windows │ ├── ConditionVariable.hpp │ ├── Mutex.hpp │ ├── SharedMutex.hpp │ └── Thread.hpp ├── transaction ├── AccessMode.cpp ├── AccessMode.hpp ├── CMakeLists.txt ├── CycleDetector.cpp ├── CycleDetector.hpp ├── DeadLockDetector.cpp ├── DeadLockDetector.hpp ├── DirectedGraph.hpp ├── Lock.hpp ├── LockManager.cpp ├── LockManager.hpp ├── LockRequest.hpp ├── LockTable.cpp ├── LockTable.hpp ├── ResourceId.cpp ├── ResourceId.hpp ├── StronglyConnectedComponents.cpp ├── StronglyConnectedComponents.hpp ├── Transaction.hpp ├── TransactionModule.hpp ├── TransactionTable.cpp ├── TransactionTable.hpp └── tests │ ├── AccessMode_unittest.cpp │ ├── CycleDetector_unittest.cpp │ ├── DeadLockDetector_unittest.cpp │ ├── DirectedGraph_unittest.cpp │ ├── LockRequest_unittest.cpp │ ├── LockTable_unittest.cpp │ ├── Lock_unittest.cpp │ ├── ResourceId_unittest.cpp │ ├── StronglyConnectedComponents_unittest.cpp │ └── TransactionTable_unittest.cpp ├── types ├── CMakeLists.txt ├── CharType.cpp ├── CharType.hpp ├── DateOperatorOverloads.hpp ├── DateType.cpp ├── DateType.hpp ├── DatetimeIntervalType.cpp ├── DatetimeIntervalType.hpp ├── DatetimeLit.hpp ├── DatetimeType.cpp ├── DatetimeType.hpp ├── DoubleType.cpp ├── DoubleType.hpp ├── FloatType.cpp ├── FloatType.hpp ├── IntType.cpp ├── IntType.hpp ├── IntervalLit.hpp ├── IntervalParser.cpp ├── IntervalParser.hpp ├── LongType.cpp ├── LongType.hpp ├── NullCoercibilityCheckMacro.hpp ├── NullType.hpp ├── NumericSuperType.hpp ├── NumericTypeUnifier.hpp ├── README.md ├── Type.cpp ├── Type.hpp ├── Type.proto ├── TypeErrors.hpp ├── TypeFactory.cpp ├── TypeFactory.hpp ├── TypeID.cpp ├── TypeID.hpp ├── TypedValue.cpp ├── TypedValue.hpp ├── TypedValue.proto ├── TypesModule.hpp ├── VarCharType.cpp ├── VarCharType.hpp ├── YearMonthIntervalType.cpp ├── YearMonthIntervalType.hpp ├── containers │ ├── CMakeLists.txt │ ├── ColumnVector.cpp │ ├── ColumnVector.hpp │ ├── ColumnVectorUtil.hpp │ ├── ColumnVectorsValueAccessor.hpp │ ├── Tuple.hpp │ ├── Tuple.proto │ └── tests │ │ └── ColumnVector_unittest.cpp ├── operations │ ├── CMakeLists.txt │ ├── Operation.cpp │ ├── Operation.hpp │ ├── Operation.proto │ ├── binary_operations │ │ ├── AddBinaryOperation.cpp │ │ ├── AddBinaryOperation.hpp │ │ ├── ArithmeticBinaryOperation.hpp │ │ ├── ArithmeticBinaryOperators.hpp │ │ ├── BinaryOperation.cpp │ │ ├── BinaryOperation.hpp │ │ ├── BinaryOperationFactory.cpp │ │ ├── BinaryOperationFactory.hpp │ │ ├── BinaryOperationID.cpp │ │ ├── BinaryOperationID.hpp │ │ ├── CMakeLists.txt │ │ ├── DivideBinaryOperation.cpp │ │ ├── DivideBinaryOperation.hpp │ │ ├── ModuloBinaryOperation.cpp │ │ ├── ModuloBinaryOperation.hpp │ │ ├── MultiplyBinaryOperation.cpp │ │ ├── MultiplyBinaryOperation.hpp │ │ ├── SubtractBinaryOperation.cpp │ │ ├── SubtractBinaryOperation.hpp │ │ └── tests │ │ │ ├── AddBinaryOperation_unittest.cpp │ │ │ ├── BinaryOperationTestUtil.hpp │ │ │ ├── BinaryOperation_unittest.cpp │ │ │ ├── DivideBinaryOperation_unittest.cpp │ │ │ ├── ModuloBinaryOperation_unittest.cpp │ │ │ ├── MultiplyBinaryOperation_unittest.cpp │ │ │ └── SubtractBinaryOperation_unittest.cpp │ ├── comparisons │ │ ├── AsciiStringComparators-inl.hpp │ │ ├── AsciiStringComparators.hpp │ │ ├── BasicComparison.cpp │ │ ├── BasicComparison.hpp │ │ ├── CMakeLists.txt │ │ ├── Comparison-inl.hpp │ │ ├── Comparison.cpp │ │ ├── Comparison.hpp │ │ ├── ComparisonFactory.cpp │ │ ├── ComparisonFactory.hpp │ │ ├── ComparisonID.cpp │ │ ├── ComparisonID.hpp │ │ ├── ComparisonUtil.hpp │ │ ├── EqualComparison.cpp │ │ ├── EqualComparison.hpp │ │ ├── GreaterComparison.cpp │ │ ├── GreaterComparison.hpp │ │ ├── GreaterOrEqualComparison.cpp │ │ ├── GreaterOrEqualComparison.hpp │ │ ├── LessComparison.cpp │ │ ├── LessComparison.hpp │ │ ├── LessOrEqualComparison.cpp │ │ ├── LessOrEqualComparison.hpp │ │ ├── LiteralComparators-inl.hpp │ │ ├── LiteralComparators.hpp │ │ ├── NotEqualComparison.cpp │ │ ├── NotEqualComparison.hpp │ │ ├── PatternMatchingComparators-inl.hpp │ │ ├── PatternMatchingComparators.hpp │ │ ├── PatternMatchingComparison.cpp │ │ ├── PatternMatchingComparison.hpp │ │ └── tests │ │ │ └── Comparison_unittest.cpp │ └── unary_operations │ │ ├── ArithmeticUnaryOperations.cpp │ │ ├── ArithmeticUnaryOperations.hpp │ │ ├── ArithmeticUnaryOperators.hpp │ │ ├── CMakeLists.txt │ │ ├── DateExtractOperation.cpp │ │ ├── DateExtractOperation.hpp │ │ ├── NumericCastOperation.hpp │ │ ├── SubstringOperation.cpp │ │ ├── SubstringOperation.hpp │ │ ├── UnaryOperation.cpp │ │ ├── UnaryOperation.hpp │ │ ├── UnaryOperationFactory.cpp │ │ ├── UnaryOperationFactory.hpp │ │ ├── UnaryOperationID.cpp │ │ ├── UnaryOperationID.hpp │ │ └── tests │ │ ├── DateExtractOperation_unittest.cpp │ │ ├── NegateUnaryOperation_unittest.cpp │ │ ├── NumericCastOperation_unittest.cpp │ │ └── UnaryOperation_unittest.cpp ├── port │ ├── CMakeLists.txt │ ├── TypesPortConfig.h.in │ ├── gmtime_r.hpp │ ├── localtime_r.hpp │ ├── strnlen.hpp │ ├── tests │ │ ├── timegm_benchmark.cpp │ │ └── timegm_unittest.cpp │ ├── timegm.cpp │ └── timegm.hpp └── tests │ ├── CharType_unittest.cpp │ ├── DateType_unittest.cpp │ ├── DatetimeIntervalType_unittest.cpp │ ├── DatetimeType_unittest.cpp │ ├── DoubleType_unittest.cpp │ ├── FloatType_unittest.cpp │ ├── IntType_unittest.cpp │ ├── LongType_unittest.cpp │ ├── TypeTest_common.hpp │ ├── Type_unittest.cpp │ ├── TypedValue_unittest.cpp │ ├── VarCharType_unittest.cpp │ └── YearMonthIntervalType_unittest.cpp ├── utility ├── Alignment.hpp ├── BarrieredReadWriteConcurrentBitVector.hpp ├── BitManipulation.hpp ├── BitVector.hpp ├── BloomFilter.hpp ├── BloomFilter.proto ├── BulkIoConfiguration.cpp ├── BulkIoConfiguration.hpp ├── CMakeLists.txt ├── CalculateInstalledMemory.cpp ├── CalculateInstalledMemory.hpp ├── Cast.hpp ├── CheckSnprintf.hpp ├── ColumnVectorCache.hpp ├── CompositeHash.hpp ├── DAG.hpp ├── DisjointTreeForest.hpp ├── EqualsAnyConstant.hpp ├── ExecutionDAGVisualizer.cpp ├── ExecutionDAGVisualizer.hpp ├── Glob.cpp ├── Glob.hpp ├── HashError.hpp ├── HashPair.hpp ├── Macros.hpp ├── MemStream.hpp ├── NetworkUtil.cpp ├── NetworkUtil.hpp ├── PlanVisualizer.cpp ├── PlanVisualizer.hpp ├── PrimeNumber.cpp ├── PrimeNumber.hpp ├── PtrList.hpp ├── PtrMap.hpp ├── PtrVector.hpp ├── ScopedBuffer.hpp ├── ScopedDeleter.hpp ├── ScopedReassignment.hpp ├── ShardedLockManager.hpp ├── SortConfiguration.cpp ├── SortConfiguration.hpp ├── SortConfiguration.proto ├── SqlError.cpp ├── SqlError.hpp ├── StringUtil.cpp ├── StringUtil.hpp ├── TemplateUtil.hpp ├── ThreadSafeQueue.hpp ├── TreeStringSerializable.hpp ├── UtilityConfig.h.in ├── UtilityModule.hpp ├── VectorUtil.hpp ├── lip_filter │ ├── BitVectorExactFilter.hpp │ ├── CMakeLists.txt │ ├── LIPFilter.hpp │ ├── LIPFilter.proto │ ├── LIPFilterAdaptiveProber.hpp │ ├── LIPFilterBuilder.hpp │ ├── LIPFilterDeployment.cpp │ ├── LIPFilterDeployment.hpp │ ├── LIPFilterFactory.cpp │ ├── LIPFilterFactory.hpp │ ├── LIPFilterUtil.hpp │ └── SingleIdentityHashFilter.hpp ├── tests │ ├── BitVector_unittest.cpp │ ├── BloomFilter_unittest.cpp │ ├── CalculateInstalledMemory_unittest.cpp │ ├── DAG_unittest.cpp │ ├── DisjointTreeForest_unittest.cpp │ ├── EqualsAnyConstant_benchmark.cpp │ ├── EqualsAnyConstant_unittest.cpp │ ├── HashPair_benchmark.cpp │ ├── NetworkUtil_unittest.cpp │ ├── PrimeNumber_unittest.cpp │ ├── ScopedDeleter_unittest.cpp │ ├── ScopedReassignment_unittest.cpp │ ├── SqlError_unittest.cpp │ ├── TemplateUtil_unittest.cpp │ ├── TextBasedTestDriver_unittest.cpp │ ├── ThreadSafeQueue_unittest.cpp │ └── TreeStringSerializable_unittest.cpp └── textbased_test │ ├── TextBasedTest.cpp │ ├── TextBasedTest.hpp │ ├── TextBasedTestDriver.cpp │ ├── TextBasedTestDriver.hpp │ └── TextBasedTestRunner.hpp ├── validate_cmakelists.py └── yarn └── CMakeLists.txt /.gitattributes: -------------------------------------------------------------------------------- 1 | release export-ignore 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | /.tags 3 | /.tags_sorted_by_file 4 | /html 5 | /latex 6 | /cscope.out 7 | Makefile.in 8 | autom4te.cache 9 | .DS_Store 10 | .idea 11 | *~ 12 | third_party/src 13 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "third_party/protobuf"] 2 | path = third_party/src/protobuf 3 | url = https://github.com/google/protobuf.git 4 | -------------------------------------------------------------------------------- /CREDITS.md: -------------------------------------------------------------------------------- 1 | At the time of the intial commit in January 2016, here are the commit stats of the Quickstep committers over the past many years. 2 | 3 | | **Committer** | **# commits** | **++ lines** | **-- lines** | 4 | | :-------------- |-----------------:|------------------:|------------------:| 5 | | @craig-chasseur | 1,186 | 1,583,534 | 976,376 | 6 | | @qiangzeng | 238 | 248,651 | 52,322 | 7 | | @hbdeshmukh | 225 | 32,064 | 15,667 | 8 | | @shoban | 218 | 31,260 | 14,219 | 9 | | @zuyu | 151 | 24,645 | 14,452 | 10 | | @adalbertgerald | 120 | 9,319 | 6,315 | 11 | | @yinanli | 28 | 1,211 | 493 | 12 | | @pateljm | 24 | 724 | 365 | 13 | -------------------------------------------------------------------------------- /DISCLAIMER: -------------------------------------------------------------------------------- 1 | Apache Quickstep is an effort undergoing incubation at the Apache Software 2 | Foundation (ASF), sponsored by the Apache Incubator PMC. 3 | 4 | Incubation is required of all newly accepted projects until a further 5 | review indicates that the infrastructure, communications, and decision 6 | making process have stabilized in a manner consistent with other 7 | successful ASF projects. 8 | 9 | While incubation status is not necessarily a reflection of the 10 | completeness or stability of the code, it does indicate that the 11 | project has yet to be fully endorsed by the ASF. 12 | -------------------------------------------------------------------------------- /HISTORY.md: -------------------------------------------------------------------------------- 1 | * Initial commit 2 | -------------------------------------------------------------------------------- /NOTICE: -------------------------------------------------------------------------------- 1 | Apache Quickstep (incubating) 2 | Copyright 2017 The Apache Software Foundation. 3 | 4 | This product includes software developed at 5 | The Apache Software Foundation (http://www.apache.org/). 6 | 7 | Portions Copyright (c) 2011-2015, Quickstep Technologies, LLC. 8 | Portions Copyright (c) 2015-2016, Pivotal Software, Inc. -------------------------------------------------------------------------------- /RETIRED.md: -------------------------------------------------------------------------------- 1 | Quickstep has been retired from Apache's Incubator due to lack of 2 | activity on 30th of November 2018. 3 | 4 | Please see http://incubator.apache.org/projects/index.html for details. 5 | -------------------------------------------------------------------------------- /build/vagrant/debian-jessie-amd64/Vagrantfile: -------------------------------------------------------------------------------- 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, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | # Basic Vagrant config (API version 2) 19 | Vagrant.configure(2) do |config| 20 | # Base box: Debian 8 "Jessie" for x86-64 21 | config.vm.box = "debian/jessie64" 22 | 23 | # Give a reasonable amount of cpu and memory to the VM 24 | config.vm.provider "virtualbox" do |vb| 25 | vb.memory = 8192 26 | vb.cpus = 4 27 | end 28 | 29 | # Share the project source dir with the VM 30 | config.vm.synced_folder "../../..", "/quickstep" 31 | 32 | # Install necessary development packages 33 | config.vm.provision "shell", inline: <<-SHELL 34 | sudo apt-get update 35 | sudo apt-get install -y \ 36 | build-essential g++ clang libc++-dev gdb lldb cmake git \ 37 | protobuf-compiler libprotobuf-dev flex bison libnuma-dev iwyu 38 | SHELL 39 | end 40 | -------------------------------------------------------------------------------- /catalog/CatalogConfig.h.in: -------------------------------------------------------------------------------- 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | **/ 19 | 20 | #cmakedefine QUICKSTEP_HAVE_LIBNUMA 21 | 22 | -------------------------------------------------------------------------------- /catalog/CatalogErrors.hpp: -------------------------------------------------------------------------------- 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | **/ 19 | 20 | #ifndef QUICKSTEP_CATALOG_CATALOG_ERRORS_HPP_ 21 | #define QUICKSTEP_CATALOG_CATALOG_ERRORS_HPP_ 22 | 23 | #include 24 | #include 25 | 26 | namespace quickstep { 27 | 28 | /** \addtogroup Catalog 29 | * @{ 30 | */ 31 | 32 | class CatalogIDOverflow : public std::exception { 33 | public: 34 | explicit CatalogIDOverflow(const std::string &item_type) 35 | : message_("CatalogIDOverflow: Exceeded the maximum number of ") { 36 | message_.append(item_type); 37 | message_.append("s in catalog."); 38 | } 39 | 40 | ~CatalogIDOverflow() throw() {} 41 | 42 | virtual const char* what() const throw() { 43 | return message_.c_str(); 44 | } 45 | 46 | private: 47 | std::string message_; 48 | }; 49 | 50 | /** @} */ 51 | 52 | } // namespace quickstep 53 | 54 | #endif // QUICKSTEP_CATALOG_CATALOG_ERRORS_HPP_ 55 | -------------------------------------------------------------------------------- /catalog/CatalogModule.hpp: -------------------------------------------------------------------------------- 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | **/ 19 | 20 | /** @defgroup Catalog 21 | * 22 | * The database catalog, which contains information about all of the relations 23 | * in the database, their attributes, and the storage blocks which store their 24 | * data. 25 | **/ 26 | -------------------------------------------------------------------------------- /cli/CliConfig.h.in: -------------------------------------------------------------------------------- 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | **/ 19 | 20 | #cmakedefine QUICKSTEP_USE_LINENOISE 21 | #cmakedefine QUICKSTEP_OS_WINDOWS 22 | #cmakedefine QUICKSTEP_ENABLE_GOOGLE_PROFILER 23 | #cmakedefine QUICKSTEP_ENABLE_NETWORK_CLI 24 | -------------------------------------------------------------------------------- /cli/CliModule.hpp: -------------------------------------------------------------------------------- 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | **/ 19 | 20 | /** @defgroup CLI 21 | * 22 | * The QuickStep command-line interface. 23 | **/ 24 | -------------------------------------------------------------------------------- /cli/Constants.hpp: -------------------------------------------------------------------------------- 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | **/ 19 | 20 | #ifndef QUICKSTEP_CLI_CONSTANTS_HPP_ 21 | #define QUICKSTEP_CLI_CONSTANTS_HPP_ 22 | 23 | namespace quickstep { 24 | namespace cli { 25 | 26 | /** \addtogroup CLI 27 | * @{ 28 | */ 29 | 30 | constexpr char kDescribeDatabaseCommand[] = "\\dt"; 31 | constexpr char kDescribeTableCommand[] = "\\d"; 32 | constexpr char kAnalyzeCommand[] = "\\analyze"; 33 | 34 | /** @} */ 35 | 36 | } // namespace cli 37 | } // namespace quickstep 38 | 39 | #endif // QUICKSTEP_CLI_CONSTANTS_HPP_ 40 | -------------------------------------------------------------------------------- /cli/DropRelation.cpp: -------------------------------------------------------------------------------- 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | **/ 19 | 20 | #include "cli/DropRelation.hpp" 21 | 22 | #include 23 | 24 | #include "catalog/CatalogDatabase.hpp" 25 | #include "catalog/CatalogRelation.hpp" 26 | #include "storage/StorageBlockInfo.hpp" 27 | #include "storage/StorageManager.hpp" 28 | #include "utility/Macros.hpp" 29 | 30 | namespace quickstep { 31 | 32 | void DropRelation::Drop(const CatalogRelation &relation, 33 | CatalogDatabase *database, 34 | StorageManager *storage_manager) { 35 | std::vector relation_blocks(relation.getBlocksSnapshot()); 36 | for (const block_id relation_block_id : relation_blocks) { 37 | storage_manager->deleteBlockOrBlobFile(relation_block_id); 38 | } 39 | 40 | const relation_id rel_id = relation.getID(); 41 | DEBUG_ASSERT(database->hasRelationWithId(rel_id)); 42 | database->dropRelationById(rel_id); 43 | } 44 | 45 | } // namespace quickstep 46 | -------------------------------------------------------------------------------- /cli/DropRelation.hpp: -------------------------------------------------------------------------------- 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | **/ 19 | 20 | #ifndef QUICKSTEP_CLI_DROP_RELATION_HPP_ 21 | #define QUICKSTEP_CLI_DROP_RELATION_HPP_ 22 | 23 | #include "storage/StorageBlockInfo.hpp" 24 | #include "utility/Macros.hpp" 25 | 26 | namespace quickstep { 27 | 28 | class CatalogDatabase; 29 | class CatalogRelation; 30 | class StorageManager; 31 | 32 | /** \addtogroup CLI 33 | * @{ 34 | */ 35 | 36 | /** 37 | * @brief All static methods which drop a relation. 38 | **/ 39 | class DropRelation { 40 | public: 41 | static void Drop(const CatalogRelation &relation, 42 | CatalogDatabase *database, 43 | StorageManager *storage_manager); 44 | 45 | private: 46 | // Undefined default constructor. Class is all-static and should not be 47 | // instantiated. 48 | DropRelation(); 49 | 50 | DISALLOW_COPY_AND_ASSIGN(DropRelation); 51 | }; 52 | 53 | /** @} */ 54 | 55 | } // namespace quickstep 56 | 57 | #endif // QUICKSTEP_CLI_DROP_RELATION_HPP_ 58 | -------------------------------------------------------------------------------- /cli/Flags.hpp: -------------------------------------------------------------------------------- 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | **/ 19 | 20 | #ifndef QUICKSTEP_CLI_FLAGS_HPP_ 21 | #define QUICKSTEP_CLI_FLAGS_HPP_ 22 | 23 | #include "gflags/gflags_declare.h" 24 | 25 | namespace quickstep { 26 | 27 | /** \addtogroup CLI 28 | * @{ 29 | */ 30 | 31 | /** 32 | * @brief A collection of common flags shared by Quickstep CLIs in both the 33 | * single-node and the distributed version. 34 | **/ 35 | 36 | DECLARE_bool(print_query); 37 | 38 | DECLARE_bool(initialize_db); 39 | 40 | DECLARE_int32(num_workers); 41 | 42 | DECLARE_string(worker_affinities); 43 | 44 | DECLARE_string(storage_path); 45 | 46 | DECLARE_bool(preload_buffer_pool); 47 | 48 | DECLARE_bool(display_timing); 49 | 50 | /** @} */ 51 | 52 | } // namespace quickstep 53 | 54 | #endif // QUICKSTEP_CLI_FLAGS_HPP_ 55 | -------------------------------------------------------------------------------- /cli/LineReaderBuffered.cpp: -------------------------------------------------------------------------------- 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | **/ 19 | 20 | #include "cli/LineReaderBuffered.hpp" 21 | 22 | #include 23 | 24 | namespace quickstep { 25 | 26 | LineReaderBuffered::LineReaderBuffered(const std::string &default_prompt, 27 | const std::string &continue_prompt) 28 | : LineReader(default_prompt, continue_prompt), 29 | buffer_empty_(true) {} 30 | 31 | LineReaderBuffered::LineReaderBuffered() : LineReader("", ""), buffer_empty_(true) {} 32 | 33 | std::string LineReaderBuffered::getLineInternal(const bool continuing) { 34 | // This method is called when the leftover_ string is depleted. 35 | buffer_empty_ = true; 36 | return ""; 37 | } 38 | 39 | } // namespace quickstep 40 | -------------------------------------------------------------------------------- /cli/LineReaderDumb.hpp: -------------------------------------------------------------------------------- 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | **/ 19 | 20 | #ifndef QUICKSTEP_CLI_LINE_READER_DUMB_HPP_ 21 | #define QUICKSTEP_CLI_LINE_READER_DUMB_HPP_ 22 | 23 | #include 24 | 25 | #include "cli/LineReader.hpp" 26 | #include "utility/Macros.hpp" 27 | 28 | namespace quickstep { 29 | 30 | /** \addtogroup CLI 31 | * @{ 32 | */ 33 | 34 | /** 35 | * @brief An implementation of LineReader that uses cstdio and doesn't support 36 | * history or command editing. 37 | **/ 38 | class LineReaderDumb : public LineReader { 39 | public: 40 | LineReaderDumb(const std::string &default_prompt, 41 | const std::string &continue_prompt); 42 | 43 | protected: 44 | std::string getLineInternal(const bool continuing) override; 45 | 46 | private: 47 | DISALLOW_COPY_AND_ASSIGN(LineReaderDumb); 48 | }; 49 | 50 | /** @} */ 51 | 52 | } // namespace quickstep 53 | 54 | #endif // QUICKSTEP_CLI_LINE_READER_DUMB_HPP_ 55 | -------------------------------------------------------------------------------- /cli/LineReaderLineNoise.hpp: -------------------------------------------------------------------------------- 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | **/ 19 | 20 | #ifndef QUICKSTEP_CLI_LINE_READER_LINE_NOISE_HPP_ 21 | #define QUICKSTEP_CLI_LINE_READER_LINE_NOISE_HPP_ 22 | 23 | #include 24 | 25 | #include "cli/LineReader.hpp" 26 | #include "utility/Macros.hpp" 27 | 28 | namespace quickstep { 29 | 30 | /** \addtogroup CLI 31 | * @{ 32 | */ 33 | 34 | /** 35 | * @brief An implementation of LineReader that uses linenoise to provide 36 | * command-history and editing support. 37 | **/ 38 | class LineReaderLineNoise : public LineReader { 39 | public: 40 | LineReaderLineNoise(const std::string &default_prompt, 41 | const std::string &continue_prompt); 42 | 43 | ~LineReaderLineNoise() override { 44 | } 45 | 46 | protected: 47 | std::string getLineInternal(const bool continuing) override; 48 | 49 | private: 50 | DISALLOW_COPY_AND_ASSIGN(LineReaderLineNoise); 51 | }; 52 | 53 | /** @} */ 54 | 55 | } // namespace quickstep 56 | 57 | #endif // QUICKSTEP_CLI_LINE_READER_LINE_NOISE_HPP_ 58 | -------------------------------------------------------------------------------- /cli/NetworkCli.proto: -------------------------------------------------------------------------------- 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, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | syntax = "proto3"; 19 | 20 | package quickstep; 21 | 22 | service NetworkCli { 23 | rpc SendQuery (QueryRequest) returns (QueryResponse) {} 24 | } 25 | 26 | message QueryRequest { 27 | string query = 1; 28 | } 29 | 30 | message QueryResponse { 31 | string query_result = 1; 32 | string error_result = 2; 33 | } 34 | -------------------------------------------------------------------------------- /cli/distributed/CliDistributedModule.hpp: -------------------------------------------------------------------------------- 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | **/ 19 | 20 | /** @defgroup CliDistributed 21 | * 22 | * The distributed QuickStep command-line interface. 23 | **/ 24 | -------------------------------------------------------------------------------- /cmake/FindGSasl.cmake: -------------------------------------------------------------------------------- 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, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | # - Try to find the GNU sasl library (gsasl) 19 | # 20 | # Once done this will define 21 | # 22 | # GSASL_FOUND - System has gnutls 23 | # GSASL_INCLUDE_DIR - The gnutls include directory 24 | # GSASL_LIBRARY - The libraries needed to use gnutls 25 | 26 | 27 | IF (GSASL_INCLUDE_DIR AND GSASL_LIBRARY) 28 | # in cache already 29 | SET(GSASL_FIND_QUIETLY TRUE) 30 | ENDIF (GSASL_INCLUDE_DIR AND GSASL_LIBRARY) 31 | 32 | FIND_PATH(GSASL_INCLUDE_DIR gsasl.h) 33 | 34 | FIND_LIBRARY(GSASL_LIBRARY gsasl) 35 | 36 | INCLUDE(FindPackageHandleStandardArgs) 37 | 38 | # handle the QUIETLY and REQUIRED arguments and set GSASL_FOUND to TRUE if 39 | # all listed variables are TRUE 40 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(GSASL DEFAULT_MSG GSASL_LIBRARY GSASL_INCLUDE_DIR) 41 | 42 | MARK_AS_ADVANCED(GSASL_INCLUDE_DIR GSASL_LIBRARY) 43 | -------------------------------------------------------------------------------- /cmake/FindKerberos.cmake: -------------------------------------------------------------------------------- 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, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | # - Find kerberos 19 | # Find the native KERBEROS includes and library 20 | # 21 | # KERBEROS_INCLUDE_DIR - where to find krb5.h, etc. 22 | # KERBEROS_LIBRARY - List of libraries when using krb5. 23 | # KERBEROS_FOUND - True if krb5 found. 24 | 25 | IF (KERBEROS_INCLUDE_DIR) 26 | # Already in cache, be silent 27 | SET(KERBEROS_FIND_QUIETLY TRUE) 28 | ENDIF (KERBEROS_INCLUDE_DIR) 29 | 30 | FIND_PATH(KERBEROS_INCLUDE_DIR krb5.h) 31 | 32 | SET(KERBEROS_NAMES krb5 k5crypto com_err) 33 | FIND_LIBRARY(KERBEROS_LIBRARY NAMES ${KERBEROS_NAMES}) 34 | 35 | # handle the QUIETLY and REQUIRED arguments and set KERBEROS_FOUND to TRUE if 36 | # all listed variables are TRUE 37 | INCLUDE(FindPackageHandleStandardArgs) 38 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(KERBEROS DEFAULT_MSG KERBEROS_LIBRARY KERBEROS_INCLUDE_DIR) 39 | 40 | MARK_AS_ADVANCED(KERBEROS_LIBRARY KERBEROS_INCLUDE_DIR) 41 | -------------------------------------------------------------------------------- /cmake/FindLibNuma.cmake: -------------------------------------------------------------------------------- 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, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | # Module to find LibNuma 19 | find_path(LIBNUMA_INCLUDE_DIR NAMES numa.h numaif.h) 20 | find_library(LIBNUMA_LIBRARY NAMES numa) 21 | 22 | include (FindPackageHandleStandardArgs) 23 | find_package_handle_standard_args(LibNuma DEFAULT_MSG 24 | LIBNUMA_LIBRARY 25 | LIBNUMA_INCLUDE_DIR) 26 | 27 | mark_as_advanced(LIBNUMA_INCLUDE_DIR LIBNUMA_LIBRARY) 28 | 29 | -------------------------------------------------------------------------------- /cmake/FindLibhdfs3.cmake: -------------------------------------------------------------------------------- 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, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | # Module to find the Pivotal libhdfs3. 19 | 20 | find_path(LIBHDFS3_INCLUDE_DIR hdfs/hdfs.h) 21 | 22 | find_library(LIBHDFS3_LIBRARY NAMES hdfs3 libhdfs3) 23 | 24 | # Linking against libhdfs3 also requires linking against gsasl and kerberos. 25 | find_package(GSasl REQUIRED) 26 | find_package(Kerberos REQUIRED) 27 | 28 | set(LIBHDFS3_LIBRARIES ${LIBHDFS3_LIBRARY} 29 | ${GSASL_LIBRARY} 30 | ${KERBEROS_LIBRARY}) 31 | set(LIBHDFS3_INCLUDE_DIRS ${LIBHDFS3_INCLUDE_DIR} 32 | ${GSASL_INCLUDE_DIR} 33 | ${KERBEROS_INCLUDE_DIR}) 34 | 35 | include(FindPackageHandleStandardArgs) 36 | find_package_handle_standard_args(Libhdfs3 DEFAULT_MSG 37 | LIBHDFS3_LIBRARY LIBHDFS3_INCLUDE_DIR) 38 | 39 | mark_as_advanced(LIBHDFS3_INCLUDE_DIR LIBHDFS3_LIBRARY) 40 | -------------------------------------------------------------------------------- /compression/CompressionModule.hpp: -------------------------------------------------------------------------------- 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | **/ 19 | 20 | /** @defgroup Compression 21 | * 22 | * Facilities for ordered dictionary-based compression of values to 23 | * fixed-length integer codes. 24 | **/ 25 | -------------------------------------------------------------------------------- /empty_src.cpp: -------------------------------------------------------------------------------- 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | **/ 19 | 20 | // On OSX, ranlib complains if a static library archive contains no symbols, 21 | // so we export a dummy global variable. 22 | #ifdef __APPLE__ 23 | namespace quickstep { extern constexpr int kDarwinGlobalDummy = 0; } 24 | #endif 25 | -------------------------------------------------------------------------------- /expressions/Expression.hpp: -------------------------------------------------------------------------------- 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | **/ 19 | 20 | #ifndef QUICKSTEP_EXPRESSIONS_EXPRESSION_HPP_ 21 | #define QUICKSTEP_EXPRESSIONS_EXPRESSION_HPP_ 22 | 23 | #include "utility/Macros.hpp" 24 | #include "utility/TreeStringSerializable.hpp" 25 | 26 | namespace quickstep { 27 | 28 | /** \addtogroup Expressions 29 | * @{ 30 | */ 31 | 32 | /** 33 | * @brief Base class for all expressions (scalars and predicates) in the backend. 34 | */ 35 | class Expression : public TreeStringSerializable { 36 | public: 37 | /** 38 | * @brief Virtual destructor. 39 | **/ 40 | virtual ~Expression() {} 41 | 42 | protected: 43 | Expression() {} 44 | 45 | private: 46 | DISALLOW_COPY_AND_ASSIGN(Expression); 47 | }; 48 | 49 | /** @} */ 50 | 51 | } // namespace quickstep 52 | 53 | #endif // QUICKSTEP_EXPRESSIONS_EXPRESSION_HPP_ 54 | -------------------------------------------------------------------------------- /expressions/ExpressionsModule.hpp: -------------------------------------------------------------------------------- 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | **/ 19 | 20 | /** @defgroup Expressions 21 | * 22 | * A system for evaluating expressions and predicates on data. 23 | **/ 24 | -------------------------------------------------------------------------------- /expressions/aggregation/AggregateFunction.proto: -------------------------------------------------------------------------------- 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, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | syntax = "proto2"; 19 | 20 | package quickstep.serialization; 21 | 22 | message AggregateFunction { 23 | enum AggregationID { 24 | AVG = 0; 25 | COUNT = 1; 26 | MAX = 2; 27 | MIN = 3; 28 | SUM = 4; 29 | } 30 | 31 | required AggregationID aggregation_id = 1; 32 | } 33 | -------------------------------------------------------------------------------- /expressions/aggregation/AggregationID.hpp: -------------------------------------------------------------------------------- 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | **/ 19 | 20 | #ifndef QUICKSTEP_EXPRESSIONS_AGGREGATION_AGGREGATION_ID_HPP_ 21 | #define QUICKSTEP_EXPRESSIONS_AGGREGATION_AGGREGATION_ID_HPP_ 22 | 23 | namespace quickstep { 24 | 25 | /** \addtogroup Expressions 26 | * @{ 27 | */ 28 | 29 | /** 30 | * @brief The possible types of aggregations. 31 | **/ 32 | enum class AggregationID { 33 | kAvg = 0, 34 | kCount, 35 | kMax, 36 | kMin, 37 | kSum 38 | }; 39 | 40 | /** @} */ 41 | 42 | } // namespace quickstep 43 | 44 | #endif // QUICKSTEP_EXPRESSIONS_AGGREGATION_AGGREGATION_ID_HPP_ 45 | -------------------------------------------------------------------------------- /expressions/table_generator/GeneratorFunction.proto: -------------------------------------------------------------------------------- 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, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | syntax = "proto2"; 19 | 20 | package quickstep.serialization; 21 | 22 | import "types/TypedValue.proto"; 23 | 24 | message GeneratorFunctionHandle { 25 | required string function_name = 1; 26 | repeated TypedValue args = 2; 27 | } 28 | -------------------------------------------------------------------------------- /expressions/window_aggregation/WindowAggregateFunction.proto: -------------------------------------------------------------------------------- 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, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | syntax = "proto2"; 19 | 20 | package quickstep.serialization; 21 | 22 | message WindowAggregateFunction { 23 | enum WindowAggregationID { 24 | AVG = 0; 25 | COUNT = 1; 26 | MAX = 2; 27 | MIN = 3; 28 | SUM = 4; 29 | } 30 | 31 | required WindowAggregationID window_aggregation_id = 1; 32 | } 33 | -------------------------------------------------------------------------------- /expressions/window_aggregation/WindowAggregationID.hpp: -------------------------------------------------------------------------------- 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | **/ 19 | 20 | #ifndef QUICKSTEP_EXPRESSIONS_WINDOW_AGGREGATION_WINDOW_AGGREGATION_ID_HPP_ 21 | #define QUICKSTEP_EXPRESSIONS_WINDOW_AGGREGATION_WINDOW_AGGREGATION_ID_HPP_ 22 | 23 | namespace quickstep { 24 | 25 | /** \addtogroup Expressions 26 | * @{ 27 | */ 28 | 29 | /** 30 | * @brief The possible types of window aggregations. 31 | **/ 32 | enum class WindowAggregationID { 33 | kAvg, 34 | kCount, 35 | kMin, 36 | kMax, 37 | kSum 38 | }; 39 | 40 | /** @} */ 41 | 42 | } // namespace quickstep 43 | 44 | #endif // QUICKSTEP_EXPRESSIONS_WINDOW_AGGREGATION_WINDOW_AGGREGATION_ID_HPP_ 45 | -------------------------------------------------------------------------------- /parser/ParseBlockProperties.cpp: -------------------------------------------------------------------------------- 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | **/ 19 | 20 | #include "parser/ParseBlockProperties.hpp" 21 | 22 | #include 23 | 24 | namespace quickstep { 25 | 26 | const char ParseBlockProperties::kKeyBlockSizeMB[] = "blocksizemb"; 27 | const char ParseBlockProperties::kKeyCompress[] = "compress"; 28 | const char ParseBlockProperties::kKeySort[] = "sort"; 29 | const char ParseBlockProperties::kKeyType[] = "type"; 30 | 31 | } // namespace quickstep 32 | -------------------------------------------------------------------------------- /parser/ParseGeneratorTableReference.cpp: -------------------------------------------------------------------------------- 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | **/ 19 | 20 | #include "parser/ParseGeneratorTableReference.hpp" 21 | 22 | #include 23 | #include 24 | 25 | namespace quickstep { 26 | 27 | class ParseTreeNode; 28 | 29 | void ParseGeneratorTableReference::getFieldStringItems( 30 | std::vector *inline_field_names, 31 | std::vector *inline_field_values, 32 | std::vector *non_container_child_field_names, 33 | std::vector *non_container_child_fields, 34 | std::vector *container_child_field_names, 35 | std::vector> *container_child_fields) const { 36 | non_container_child_field_names->push_back(""); 37 | non_container_child_fields->push_back(generator_function_.get()); 38 | } 39 | 40 | } // namespace quickstep 41 | -------------------------------------------------------------------------------- /parser/ParseHaving.cpp: -------------------------------------------------------------------------------- 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | **/ 19 | 20 | #include "parser/ParseHaving.hpp" 21 | 22 | #include 23 | #include 24 | 25 | #include "parser/ParsePredicate.hpp" 26 | 27 | namespace quickstep { 28 | 29 | void ParseHaving::getFieldStringItems(std::vector *inline_field_names, 30 | std::vector *inline_field_values, 31 | std::vector *non_container_child_field_names, 32 | std::vector *non_container_child_fields, 33 | std::vector *container_child_field_names, 34 | std::vector> *container_child_fields) const { 35 | non_container_child_field_names->push_back(""); 36 | non_container_child_fields->push_back(having_predicate_.get()); 37 | } 38 | 39 | } // namespace quickstep 40 | -------------------------------------------------------------------------------- /parser/ParseIndexProperties.cpp: -------------------------------------------------------------------------------- 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | **/ 19 | 20 | #include "parser/ParseIndexProperties.hpp" 21 | 22 | namespace quickstep { 23 | // Initialize constants for various index properties. 24 | const char *BitWeavingIndexProperties::kBitWeavingType = "type"; 25 | const char *BloomFilterIndexProperties::kBloomFilterSizeInBytes = "size"; 26 | const char *BloomFilterIndexProperties::kBloomFilterNumHashes = "num_hashes"; 27 | const char *BloomFilterIndexProperties::kBloomFilterProjectElementCount = "projected_element_count"; 28 | 29 | } // namespace quickstep 30 | -------------------------------------------------------------------------------- /parser/ParseLimit.cpp: -------------------------------------------------------------------------------- 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | **/ 19 | 20 | #include "parser/ParseLimit.hpp" 21 | 22 | #include 23 | #include 24 | 25 | #include "parser/ParseLiteralValue.hpp" 26 | 27 | namespace quickstep { 28 | 29 | void ParseLimit::getFieldStringItems(std::vector *inline_field_names, 30 | std::vector *inline_field_values, 31 | std::vector *non_container_child_field_names, 32 | std::vector *non_container_child_fields, 33 | std::vector *container_child_field_names, 34 | std::vector> *container_child_fields) const { 35 | non_container_child_field_names->push_back(""); 36 | non_container_child_fields->push_back(limit_expression_.get()); 37 | } 38 | 39 | } // namespace quickstep 40 | -------------------------------------------------------------------------------- /parser/ParseSample.cpp: -------------------------------------------------------------------------------- 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | **/ 19 | 20 | #include "parser/ParseSample.hpp" 21 | 22 | #include 23 | #include 24 | 25 | #include "parser/ParseLiteralValue.hpp" 26 | 27 | namespace quickstep { 28 | 29 | void ParseSample::getFieldStringItems(std::vector *inline_field_names, 30 | std::vector *inline_field_values, 31 | std::vector *non_container_child_field_names, 32 | std::vector *non_container_child_fields, 33 | std::vector *container_child_field_names, 34 | std::vector> *container_child_fields) const { 35 | non_container_child_field_names->push_back("Sample Percentage"); 36 | non_container_child_fields->push_back(percentage_.get()); 37 | } 38 | 39 | } // namespace quickstep 40 | -------------------------------------------------------------------------------- /parser/ParseString.cpp: -------------------------------------------------------------------------------- 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | **/ 19 | 20 | #include "parser/ParseString.hpp" 21 | 22 | #include 23 | #include 24 | 25 | namespace quickstep { 26 | 27 | void ParseString::getFieldStringItems( 28 | std::vector *inline_field_names, std::vector *inline_field_values, 29 | std::vector *non_container_child_field_names, 30 | std::vector *non_container_child_fields, 31 | std::vector *container_child_field_names, 32 | std::vector> *container_child_fields) const { 33 | inline_field_names->push_back("value"); 34 | inline_field_values->push_back(value_); 35 | } 36 | 37 | } // namespace quickstep 38 | -------------------------------------------------------------------------------- /parser/ParserModule.hpp: -------------------------------------------------------------------------------- 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | **/ 19 | 20 | /** @defgroup Parser 21 | * 22 | * Quickstep's SQL parser. 23 | **/ 24 | -------------------------------------------------------------------------------- /parser/preprocessed/genfiles.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 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, 14 | # software distributed under the License is distributed on an 15 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | # KIND, either express or implied. See the License for the 17 | # specific language governing permissions and limitations 18 | # under the License. 19 | 20 | flex -i -I --header-file=SqlLexer_gen.hpp -oSqlLexer_gen.cpp ../SqlLexer.lpp 21 | bison -d -o SqlParser_gen.cpp ../SqlParser.ypp 22 | -------------------------------------------------------------------------------- /parser/tests/Alter.test: -------------------------------------------------------------------------------- 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, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | ALTER TABLE test 19 | ADD attr INT 20 | -- 21 | ERROR: syntax error (2 : 5) 22 | ADD attr INT 23 | ^ 24 | == 25 | 26 | ALTER TABLE test 27 | ADD COLUMN attr INT 28 | -- 29 | ERROR: ALTER statements is not supported yet (1 : 1) 30 | ALTER TABLE test 31 | ^ 32 | == 33 | 34 | ALTER TABLE test 35 | DROP COLUMN attr INT 36 | -- 37 | [same as above] 38 | == 39 | 40 | ALTER TABLE test 41 | ADD CONSTRAINT UNIQUE(attr) 42 | -- 43 | ERROR: Table Constraints (UNIQUE) is not supported yet (2 : 16) 44 | ADD CONSTRAINT UNIQUE(attr) 45 | ^ 46 | == 47 | 48 | ALTER TABLE test 49 | DROP CONSTRAINT constraint0 50 | -- 51 | ERROR: ALTER statements is not supported yet (1 : 1) 52 | ALTER TABLE test 53 | ^ 54 | -------------------------------------------------------------------------------- /parser/tests/Delete.test: -------------------------------------------------------------------------------- 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, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | DELETE FROM test WHERE tb1=1 19 | -- 20 | DeleteStatement[relation_name=test] 21 | +-where_predicate=Equal 22 | +-left_operand=AttributeReference[attribute_name=tb1] 23 | +-right_operand=Literal 24 | +-NumericLiteral[numeric_string=1,float_like=false] 25 | == 26 | 27 | DELETE FROM test 28 | -- 29 | DeleteStatement[relation_name=test] 30 | == 31 | 32 | DELETE FROM TABLE 33 | -- 34 | ERROR: syntax error (1 : 13) 35 | DELETE FROM TABLE 36 | ^ 37 | == 38 | 39 | DELETE FROM TABLE test 40 | -- 41 | ERROR: syntax error (1 : 13) 42 | DELETE FROM TABLE test 43 | ^ 44 | == 45 | 46 | DELETE FROM test1, test2 47 | -- 48 | ERROR: syntax error (1 : 18) 49 | DELETE FROM test1, test2 50 | ^ 51 | -------------------------------------------------------------------------------- /parser/tests/Drop.test: -------------------------------------------------------------------------------- 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, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | DROP TABLE test 19 | -- 20 | DropTableStatement[relation_name=test] 21 | == 22 | 23 | DROP TABLE TABLE 24 | -- 25 | ERROR: syntax error (1 : 12) 26 | DROP TABLE TABLE 27 | ^ 28 | -------------------------------------------------------------------------------- /query_execution/QueryExecutionModule.hpp: -------------------------------------------------------------------------------- 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | **/ 19 | 20 | /** @defgroup QueryExecution 21 | * 22 | * The components of query execution including Workers, Foreman (co-ordinator), 23 | * message classes for queues and for inter thread communication. 24 | **/ 25 | -------------------------------------------------------------------------------- /query_optimizer/OptimizerContext.cpp: -------------------------------------------------------------------------------- 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | **/ 19 | 20 | #include "query_optimizer/OptimizerContext.hpp" 21 | 22 | #include 23 | 24 | namespace quickstep { 25 | namespace optimizer { 26 | 27 | const char *OptimizerContext::kInternalTemporaryRelationNamePrefix = "_qstemp_result_"; 28 | 29 | } // namespace optimizer 30 | } // namespace quickstep 31 | -------------------------------------------------------------------------------- /query_optimizer/QueryOptimizerConfig.h.in: -------------------------------------------------------------------------------- 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | **/ 19 | 20 | #cmakedefine QUICKSTEP_DISTRIBUTED 21 | -------------------------------------------------------------------------------- /query_optimizer/QueryOptimizerModule.hpp: -------------------------------------------------------------------------------- 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | **/ 19 | 20 | /** @defgroup QueryOptimizer 21 | * 22 | * A system to prepare and optimize query plans for parsed SQL statements. 23 | **/ 24 | -------------------------------------------------------------------------------- /query_optimizer/cost_model/CostModelModule.hpp: -------------------------------------------------------------------------------- 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | **/ 19 | 20 | /** @defgroup CostModel 21 | * @ingroup QueryOptimizer 22 | * 23 | * Models that estimate the costs of physical plans. 24 | **/ 25 | -------------------------------------------------------------------------------- /query_optimizer/expressions/ExprId.hpp: -------------------------------------------------------------------------------- 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | **/ 19 | 20 | #ifndef QUICKSTEP_QUERY_OPTIMIZER__EXPRESSIONS_EXPR_ID_HPP_ 21 | #define QUICKSTEP_QUERY_OPTIMIZER__EXPRESSIONS_EXPR_ID_HPP_ 22 | 23 | namespace quickstep { 24 | namespace optimizer { 25 | namespace expressions { 26 | 27 | /** \addtogroup OptimizerExpressions 28 | * @{ 29 | */ 30 | 31 | /** 32 | * @brief Expression ID for a named expression. 33 | */ 34 | typedef int ExprId; 35 | 36 | /** @} */ 37 | 38 | } // namespace expressions 39 | } // namespace optimizer 40 | } // namespace quickstep 41 | 42 | #endif /* QUICKSTEP_QUERY_OPTIMIZER__EXPRESSIONS_EXPR_ID_HPP_ */ 43 | -------------------------------------------------------------------------------- /query_optimizer/expressions/OptimizerExpressionsModule.hpp: -------------------------------------------------------------------------------- 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | **/ 19 | 20 | /** @defgroup OptimizerExpressions 21 | * @ingroup QueryOptimizer 22 | * 23 | * Expressions used in the query optimizer. 24 | **/ 25 | -------------------------------------------------------------------------------- /query_optimizer/logical/OptimizerLogicalModule.hpp: -------------------------------------------------------------------------------- 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | **/ 19 | 20 | /** @defgroup OptimizerLogical 21 | * @ingroup QueryOptimizer 22 | * 23 | * Logical operators used in the query optimizer. 24 | **/ 25 | -------------------------------------------------------------------------------- /query_optimizer/physical/DropTable.cpp: -------------------------------------------------------------------------------- 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | **/ 19 | 20 | #include "query_optimizer/physical/DropTable.hpp" 21 | 22 | #include 23 | #include 24 | 25 | #include "catalog/CatalogRelation.hpp" 26 | #include "query_optimizer/OptimizerTree.hpp" 27 | 28 | namespace quickstep { 29 | namespace optimizer { 30 | namespace physical { 31 | 32 | void DropTable::getFieldStringItems( 33 | std::vector *inline_field_names, 34 | std::vector *inline_field_values, 35 | std::vector *non_container_child_field_names, 36 | std::vector *non_container_child_fields, 37 | std::vector *container_child_field_names, 38 | std::vector> *container_child_fields) const { 39 | inline_field_names->push_back("relation"); 40 | inline_field_values->push_back(catalog_relation_->getName()); 41 | } 42 | 43 | } // namespace physical 44 | } // namespace optimizer 45 | } // namespace quickstep 46 | -------------------------------------------------------------------------------- /query_optimizer/physical/OptimizerPhysicalModule.hpp: -------------------------------------------------------------------------------- 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | **/ 19 | 20 | /** @defgroup OptimizerPhysical 21 | * @ingroup QueryOptimizer 22 | * 23 | * Physical operators used in the query optimizer. 24 | **/ 25 | -------------------------------------------------------------------------------- /query_optimizer/resolver/QueryResolverModule.hpp: -------------------------------------------------------------------------------- 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | **/ 19 | 20 | /** @defgroup QueryResolver 21 | * @ingroup QueryOptimizer 22 | * 23 | * Module that performs semantic validation and analysis on parse trees. 24 | **/ 25 | -------------------------------------------------------------------------------- /query_optimizer/rules/OptimizerRulesModule.hpp: -------------------------------------------------------------------------------- 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | **/ 19 | 20 | /** @defgroup OptimizerRules 21 | * @ingroup QueryOptimizer 22 | * 23 | * Rules to transform optimizer trees. 24 | **/ 25 | -------------------------------------------------------------------------------- /query_optimizer/strategy/OptimizerStrategyModule.hpp: -------------------------------------------------------------------------------- 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | **/ 19 | 20 | /** @defgroup OptimizerStrategy 21 | * @ingroup QueryOptimizer 22 | * 23 | * Strategies to convert logical plans to physical plans. 24 | **/ 25 | -------------------------------------------------------------------------------- /query_optimizer/tests/execution_generator/Delete.test: -------------------------------------------------------------------------------- 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, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | DELETE FROM test WHERE int_col+float_col > 0; 19 | SELECT int_col+float_col FROM test; 20 | -- 21 | +-------------------+ 22 | |(int_col+float_col)| 23 | +-------------------+ 24 | | NULL| 25 | | 0| 26 | | -1.26794922| 27 | | -2.76393199| 28 | | -4.354249| 29 | | -6| 30 | | NULL| 31 | | -7.68337536| 32 | | -9.39444923| 33 | | -11.1270161| 34 | | -12.876894| 35 | | -14.6411009| 36 | | NULL| 37 | | -16.4174232| 38 | | -18.2041683| 39 | +-------------------+ 40 | -------------------------------------------------------------------------------- /query_optimizer/tests/execution_generator/Drop.test: -------------------------------------------------------------------------------- 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, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | DROP TABLE test; 19 | SELECT * FROM test 20 | -- 21 | ERROR: Unrecognized relation test (2 : 15) 22 | SELECT * FROM test 23 | ^ 24 | -------------------------------------------------------------------------------- /query_optimizer/tests/execution_generator/Update.test: -------------------------------------------------------------------------------- 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, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | # Both assignments need coercion. 19 | UPDATE test 20 | SET float_col = 2, 21 | double_col = float_col/2 22 | WHERE int_col < -10; 23 | 24 | SELECT float_col, 25 | float_col/2, 26 | double_col 27 | FROM test 28 | WHERE int_col < -20 29 | OR int_col > 20; 30 | -- 31 | +---------------+---------------+------------------------+ 32 | |float_col |(float_col/2) |double_col | 33 | +---------------+---------------+------------------------+ 34 | | 2| 1| 2.291287899017334| 35 | | 4.69041586| 2.34520793| 103.18914671611546| 36 | | 2| 1| 2.3979158401489258| 37 | | 4.89897966| 2.44948983| 117.57550765359254| 38 | +---------------+---------------+------------------------+ 39 | -------------------------------------------------------------------------------- /query_optimizer/tests/logical_generator/CMakeLists.txt: -------------------------------------------------------------------------------- 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, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | add_test(quickstep_queryoptimizer_tests_logicalgenerator_create 19 | "../quickstep_queryoptimizer_tests_OptimizerTextTest" 20 | "${CMAKE_CURRENT_SOURCE_DIR}/Create.test" 21 | "${CMAKE_CURRENT_BINARY_DIR}/Create.test") 22 | add_test(quickstep_queryoptimizer_tests_logicalgenerator_index 23 | "../quickstep_queryoptimizer_tests_OptimizerTextTest" 24 | "${CMAKE_CURRENT_SOURCE_DIR}/Index.test" 25 | "${CMAKE_CURRENT_BINARY_DIR}/Index.test") 26 | add_test(quickstep_queryoptimizer_tests_logicalgenerator_join 27 | "../quickstep_queryoptimizer_tests_OptimizerTextTest" 28 | "${CMAKE_CURRENT_SOURCE_DIR}/Join.test" 29 | "${CMAKE_CURRENT_BINARY_DIR}/Join.test") 30 | add_test(quickstep_queryoptimizer_tests_logicalgenerator_select 31 | "../quickstep_queryoptimizer_tests_OptimizerTextTest" 32 | "${CMAKE_CURRENT_SOURCE_DIR}/Select.test" 33 | "${CMAKE_CURRENT_BINARY_DIR}/Select.test") 34 | -------------------------------------------------------------------------------- /query_optimizer/tests/physical_generator/Copy.test: -------------------------------------------------------------------------------- 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, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | [default optimized_logical_plan physical_plan] 19 | copy test from 'test.txt' 20 | -- 21 | [Optimized Logical Plan] 22 | TopLevelPlan 23 | +-plan=CopyFrom[relation=Test,file_name=test.txt,column_delimiter="\t", 24 | | escape_strings=true] 25 | +-output_attributes= 26 | +-[] 27 | [Physical Plan] 28 | TopLevelPlan 29 | +-plan=CopyFrom[relation=Test,file_name=test.txt,column_delimiter="\t", 30 | | escape_strings=true] 31 | +-output_attributes= 32 | +-[] 33 | == 34 | 35 | copy test from 'test.txt' with (delimiter 'd', escape_strings false) 36 | -- 37 | [Optimized Logical Plan] 38 | TopLevelPlan 39 | +-plan=CopyFrom[relation=Test,file_name=test.txt,column_delimiter="d", 40 | | escape_strings=false] 41 | +-output_attributes= 42 | +-[] 43 | [Physical Plan] 44 | TopLevelPlan 45 | +-plan=CopyFrom[relation=Test,file_name=test.txt,column_delimiter="d", 46 | | escape_strings=false] 47 | +-output_attributes= 48 | +-[] 49 | -------------------------------------------------------------------------------- /query_optimizer/tests/physical_generator/Drop.test: -------------------------------------------------------------------------------- 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, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | [default optimized_logical_plan physical_plan] 19 | drop table test 20 | -- 21 | [Optimized Logical Plan] 22 | TopLevelPlan 23 | +-plan=DropTable[relation=Test] 24 | +-output_attributes= 25 | +-[] 26 | [Physical Plan] 27 | TopLevelPlan 28 | +-plan=DropTable[relation=Test] 29 | +-output_attributes= 30 | +-[] 31 | -------------------------------------------------------------------------------- /query_optimizer/tests/resolver/Drop.test: -------------------------------------------------------------------------------- 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, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | [default initial_logical_plan] 19 | drop table test 20 | -- 21 | TopLevelPlan 22 | +-plan=DropTable[relation=Test] 23 | +-output_attributes= 24 | +-[] 25 | == 26 | 27 | drop table TesT 28 | -- 29 | [same as above] 30 | == 31 | 32 | drop table foo 33 | -- 34 | ERROR: Unrecognized relation foo (1 : 12) 35 | drop table foo 36 | ^ 37 | -------------------------------------------------------------------------------- /relational_operators/RelationalOperatorsConfig.h.in: -------------------------------------------------------------------------------- 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | **/ 19 | 20 | #cmakedefine QUICKSTEP_HAVE_UNISTD 21 | -------------------------------------------------------------------------------- /relational_operators/RelationalOperatorsModule.hpp: -------------------------------------------------------------------------------- 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | **/ 19 | 20 | /** @defgroup RelationalOperators 21 | * 22 | * Relational operators which form query plans, and work orders which comprise 23 | * the actual work to be done in query execution. 24 | **/ 25 | -------------------------------------------------------------------------------- /relational_operators/SortMergeRunOperator.proto: -------------------------------------------------------------------------------- 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, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | syntax = "proto2"; 19 | 20 | package quickstep.serialization; 21 | 22 | message Run { 23 | repeated fixed64 blocks = 1; 24 | } 25 | 26 | message SortMergeRunOutput { 27 | required uint64 merge_level = 1; 28 | repeated fixed64 blocks = 2; 29 | } 30 | -------------------------------------------------------------------------------- /relational_operators/tests/text_scan_faulty_golden_output.txt: -------------------------------------------------------------------------------- 1 | +--------------------+------------------------+--------------------+-----------------------------------------+----------------------------------------+--------------------+ 2 | |long_attr |double_attr |char_attr |datetime_attr |interval_attr |varchar_attr | 3 | +--------------------+------------------------+--------------------+-----------------------------------------+----------------------------------------+--------------------+ 4 | | 1234| 12.34| foo| 1994-04-27T08:20:50| 12 days 00:00:00| right_row| 5 | +--------------------+------------------------+--------------------+-----------------------------------------+----------------------------------------+--------------------+ 6 | -------------------------------------------------------------------------------- /relational_operators/tests/text_scan_faulty_input.txt: -------------------------------------------------------------------------------- 1 | 1234 12.34 foo 1994-04-27T08:20:50 12 days right_row 2 | 1234 abcd foo 1994-04-27T08:20:50 12 days row_with_wrong_datatype_value 3 | 1234 foo 1994-04-27T08:20:50 12 days row_with_less_values 4 | 1234 abcd foo 1994-04-27T08:20:50 12 days bar row_with_more_values 5 | -------------------------------------------------------------------------------- /relational_operators/tests/text_scan_golden_output.txt: -------------------------------------------------------------------------------- 1 | +--------------------+------------------------+--------------------+-----------------------------------------+----------------------------------------+--------------------+ 2 | |long_attr |double_attr |char_attr |datetime_attr |interval_attr |varchar_attr | 3 | +--------------------+------------------------+--------------------+-----------------------------------------+----------------------------------------+--------------------+ 4 | | 1234| 12.34| foo| 1994-04-27T08:20:50| 12 days 00:00:00| bar| 5 | | -1234567890| -1.2e-200|A twenty char string| 1969-07-21T02:56:00| 00:00:01.001000|Another twenty chars| 6 | | NULL| NULL| NULL| NULL| NULL| NULL| 7 | | NULL| NULL| \N| NULL| NULL| \N| 8 | | 42| -42.5| { 9 | \escapedx 10 | }| 1988-07-16T00:00:00.000001| 00:00:00|'good' "bye" 11 | 12 | 13 | 14 | 15 | | 16 | | 0| 0| \\ 17 | \\ 18 | | 1970-01-01T00:00:00| 00:00:00| \\| 19 | +--------------------+------------------------+--------------------+-----------------------------------------+----------------------------------------+--------------------+ 20 | -------------------------------------------------------------------------------- /relational_operators/tests/text_scan_input.txt: -------------------------------------------------------------------------------- 1 | 1234 12.34 foo 1994-04-27T08:20:50 12 days bar 2 | -1234567890 -1.2e-200 A twenty char string 1969-07-21 02:56:00 00:00:01.001 Another twenty chars 3 | \N \N \N \N \N \N 4 | \N \N \\N \N \N \\N 5 | \x34\062 \55\064\x32\56\65 \x7B\n\t\ \\\e\s\c\a\p\e\d\x\b\n\x7d 1988-07-16\T00:00\:00\x2E0\x30\60\06001 00:00:00 'good\' \"bye"\r\n\n\r\n\v\n\n 6 | 0 0.0 \\\\\n\\\\\n 1970-01-01 0 s \\\\ 7 | -------------------------------------------------------------------------------- /storage/BlockWire.proto: -------------------------------------------------------------------------------- 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, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | syntax = "proto2"; 19 | 20 | package quickstep; 21 | 22 | message BlockResponse { 23 | required bool is_valid = 1; 24 | required bytes block = 2; 25 | } 26 | 27 | message BlockRequest { 28 | required uint64 block_id = 1; 29 | required int32 relation_id = 2; 30 | } 31 | 32 | message FinishReadingRelationMessage { 33 | required int32 relation_id = 1; 34 | } 35 | -------------------------------------------------------------------------------- /storage/DataExchange.proto: -------------------------------------------------------------------------------- 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, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | syntax = "proto3"; 19 | 20 | package quickstep; 21 | 22 | service DataExchange { 23 | rpc Pull (PullRequest) returns (PullResponse) {} 24 | } 25 | 26 | message PullRequest { 27 | fixed64 block_id = 1; 28 | } 29 | 30 | message PullResponse { 31 | bool is_valid = 1; 32 | uint64 num_slots = 2; 33 | bytes block = 3; 34 | } 35 | -------------------------------------------------------------------------------- /storage/FileManagerLocal.hpp: -------------------------------------------------------------------------------- 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | **/ 19 | 20 | #ifndef QUICKSTEP_STORAGE_FILE_MANAGER_LOCAL_HPP_ 21 | #define QUICKSTEP_STORAGE_FILE_MANAGER_LOCAL_HPP_ 22 | 23 | #include "storage/StorageConfig.h" 24 | 25 | #ifdef QUICKSTEP_HAVE_FILE_MANAGER_POSIX 26 | #include "storage/FileManagerPosix.hpp" 27 | #elif defined(QUICKSTEP_HAVE_FILE_MANAGER_WINDOWS) 28 | #include "storage/FileManagerWindows.hpp" 29 | #endif 30 | 31 | namespace quickstep { 32 | 33 | #ifdef QUICKSTEP_HAVE_FILE_MANAGER_POSIX 34 | typedef FileManagerPosix FileManagerLocal; 35 | #elif defined(QUICKSTEP_HAVE_FILE_MANAGER_WINDOWS) 36 | typedef FileManagerWindows FileManagerLocal; 37 | #endif 38 | 39 | } // namespace quickstep 40 | 41 | #endif // QUICKSTEP_STORAGE_FILE_MANAGER_LOCAL_HPP_ 42 | -------------------------------------------------------------------------------- /storage/Flags.hpp: -------------------------------------------------------------------------------- 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | **/ 19 | 20 | #ifndef QUICKSTEP_STORAGE_FLAGS_HPP_ 21 | #define QUICKSTEP_STORAGE_FLAGS_HPP_ 22 | 23 | #include "storage/StorageConfig.h" // For QUICKSTEP_HAVE_FILE_MANAGER_HDFS. 24 | 25 | #include "gflags/gflags_declare.h" 26 | 27 | namespace quickstep { 28 | 29 | /** \addtogroup STORAGE 30 | * @{ 31 | */ 32 | 33 | /** 34 | * @brief A collection of common flags shared by Quickstep STORAGEs in both the 35 | * single-node and the distributed version. 36 | **/ 37 | 38 | #ifdef QUICKSTEP_HAVE_FILE_MANAGER_HDFS 39 | DECLARE_bool(use_hdfs); 40 | 41 | DECLARE_string(hdfs_namenode_host); 42 | DECLARE_int32(hdfs_namenode_port); 43 | DECLARE_int32(hdfs_num_replications); 44 | 45 | #endif 46 | 47 | /** @} */ 48 | 49 | } // namespace quickstep 50 | 51 | #endif // QUICKSTEP_STORAGE_FLAGS_HPP_ 52 | -------------------------------------------------------------------------------- /storage/HashTable.proto: -------------------------------------------------------------------------------- 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, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | syntax = "proto2"; 19 | 20 | package quickstep.serialization; 21 | 22 | import "types/Type.proto"; 23 | 24 | enum HashTableImplType { 25 | COLLISION_FREE_VECTOR = 0; 26 | LINEAR_OPEN_ADDRESSING = 1; 27 | SEPARATE_CHAINING = 2; 28 | SIMPLE_SCALAR_SEPARATE_CHAINING = 3; 29 | THREAD_PRIVATE_COMPACT_KEY = 4; 30 | } 31 | 32 | message CollisionFreeVectorInfo { 33 | required uint64 memory_size = 1; 34 | required uint64 num_init_partitions = 2; 35 | repeated uint64 state_offsets = 3; 36 | } 37 | 38 | // NOTE(chasseur): This proto describes the run-time parameters for a resizable 39 | // HashTable. It does not describe any template parameters of the HashTable 40 | // class, which are different in different contexts (e.g. join vs. grouping). 41 | message HashTable { 42 | required HashTableImplType hash_table_impl_type = 1; 43 | repeated Type key_types = 2; 44 | required uint64 estimated_num_entries = 3; 45 | } 46 | -------------------------------------------------------------------------------- /storage/SimpleScalarSeparateChainingHashTable.cpp: -------------------------------------------------------------------------------- 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | **/ 19 | 20 | #include "storage/SimpleScalarSeparateChainingHashTable.hpp" 21 | 22 | #include 23 | 24 | namespace quickstep { 25 | namespace simple_scalar_separate_chaining_hash_table_detail { 26 | 27 | const std::vector kKeyInlineGlobal(1, true); 28 | 29 | } // namespace simple_scalar_separate_chaining_hash_table_detail 30 | } // namespace quickstep 31 | -------------------------------------------------------------------------------- /storage/StorageBlockInfo.cpp: -------------------------------------------------------------------------------- 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | **/ 19 | 20 | #include 21 | 22 | #include "storage/StorageBlockInfo.hpp" 23 | #include "utility/StringUtil.hpp" 24 | 25 | using std::string; 26 | 27 | namespace quickstep { 28 | 29 | string BlockIdUtil::ToString(const block_id block) { 30 | string block_str("("); 31 | block_str.append(ToZeroPaddedString(Domain(block), kBlockIdDomainLengthInDigits)); 32 | block_str.append(", "); 33 | block_str.append(ToZeroPaddedString(Counter(block), kBlockIdCounterLengthInDigits)); 34 | block_str.append(")"); 35 | 36 | return block_str; 37 | } 38 | 39 | const char *kTupleStorageSubBlockTypeNames[] = { 40 | "BasicColumnStore", 41 | "CompressedPackedRowStore", 42 | "CompressedColumnStore", 43 | "SplitRowStore" 44 | }; 45 | 46 | const char *kIndexSubBlockTypeNames[] = { 47 | "CSBTree", 48 | "SMA", 49 | }; 50 | 51 | } // namespace quickstep 52 | -------------------------------------------------------------------------------- /storage/StorageConfig.h.in: -------------------------------------------------------------------------------- 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | **/ 19 | 20 | #cmakedefine QUICKSTEP_HAVE_BITWEAVING 21 | #cmakedefine QUICKSTEP_HAVE_FILE_MANAGER_POSIX 22 | #cmakedefine QUICKSTEP_HAVE_FILE_MANAGER_WINDOWS 23 | #cmakedefine QUICKSTEP_HAVE_FILE_MANAGER_HDFS 24 | #cmakedefine QUICKSTEP_REBUILD_INDEX_ON_UPDATE_OVERFLOW 25 | #cmakedefine QUICKSTEP_HAVE_MMAP_LINUX_HUGETLB 26 | #cmakedefine QUICKSTEP_HAVE_MMAP_BSD_SUPERPAGE 27 | #cmakedefine QUICKSTEP_HAVE_MMAP_PLAIN 28 | #cmakedefine QUICKSTEP_HAVE_LIBNUMA 29 | -------------------------------------------------------------------------------- /storage/StorageModule.hpp: -------------------------------------------------------------------------------- 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | **/ 19 | 20 | /** @defgroup Storage 21 | * 22 | * The QuickStep storage system. 23 | **/ 24 | -------------------------------------------------------------------------------- /storage/SubBlockTypeRegistryMacros.hpp: -------------------------------------------------------------------------------- 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | **/ 19 | 20 | #ifndef QUICKSTEP_STORAGE_SUB_BLOCK_TYPE_REGISTRY_MACROS_HPP_ 21 | #define QUICKSTEP_STORAGE_SUB_BLOCK_TYPE_REGISTRY_MACROS_HPP_ 22 | 23 | #define QUICKSTEP_DECLARE_SUB_BLOCK_TYPE_REGISTERED(classname) \ 24 | namespace registry { extern const bool classname##_registered; } \ 25 | struct sub_block_type_registry_dummy /* NOLINT(build/class) */ 26 | 27 | #define QUICKSTEP_FORCE_SUB_BLOCK_REGISTRATION(classname) \ 28 | namespace registry { \ 29 | extern const bool classname##_registered; \ 30 | bool classname##_check_registered_force() { return classname##_registered; } \ 31 | } \ 32 | struct sub_block_type_registry_dummy /* NOLINT(build/class) */ 33 | 34 | #endif // QUICKSTEP_STORAGE_SUB_BLOCK_TYPE_REGISTRY_MACROS_HPP_ 35 | -------------------------------------------------------------------------------- /storage/TupleReference.hpp: -------------------------------------------------------------------------------- 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | **/ 19 | 20 | #ifndef QUICKSTEP_STORAGE_TUPLE_REFERENCE_HPP_ 21 | #define QUICKSTEP_STORAGE_TUPLE_REFERENCE_HPP_ 22 | 23 | #include "storage/StorageBlockInfo.hpp" 24 | 25 | namespace quickstep { 26 | 27 | class TupleStorageSubBlock; 28 | 29 | /** \addtogroup Storage 30 | * @{ 31 | */ 32 | 33 | /** 34 | * @brief A reference to a particular tuple in a StorageBlock. 35 | **/ 36 | struct TupleReference { 37 | TupleReference() 38 | : block(0), tuple(-1) { 39 | } 40 | 41 | TupleReference(block_id block_in, tuple_id tuple_in) 42 | : block(block_in), tuple(tuple_in) { 43 | } 44 | 45 | block_id block; 46 | tuple_id tuple; 47 | }; 48 | 49 | /** @} */ 50 | 51 | } // namespace quickstep 52 | 53 | #endif // QUICKSTEP_STORAGE_TUPLE_REFERENCE_HPP_ 54 | -------------------------------------------------------------------------------- /storage/WindowAggregationOperationState.proto: -------------------------------------------------------------------------------- 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, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | syntax = "proto2"; 19 | 20 | package quickstep.serialization; 21 | 22 | import "expressions/window_aggregation/WindowAggregateFunction.proto"; 23 | import "expressions/Expressions.proto"; 24 | 25 | message WindowAggregationOperationState { 26 | required int32 input_relation_id = 1; 27 | required WindowAggregateFunction function = 2; 28 | repeated Scalar arguments = 3; 29 | repeated Scalar partition_by_attributes = 4; 30 | required bool is_row = 5; 31 | required int64 num_preceding = 6; // -1 means UNBOUNDED PRECEDING. 32 | required int64 num_following = 7; // -1 means UNBOUNDED FOLLOWING. 33 | repeated Scalar order_by_attributes = 8; 34 | } 35 | -------------------------------------------------------------------------------- /storage/tests/FileManagerHdfs_unittest.cpp: -------------------------------------------------------------------------------- 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | **/ 19 | 20 | #include "gtest/gtest.h" 21 | 22 | #include "storage/FileManagerHdfs.hpp" 23 | #include "storage/tests/FileManager_unittest_common.hpp" 24 | 25 | QUICKSTEP_TEST_FILEMANAGER_IMPL(FileManagerHdfs); 26 | -------------------------------------------------------------------------------- /storage/tests/FileManagerLocal_unittest.cpp: -------------------------------------------------------------------------------- 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | **/ 19 | 20 | #include "gtest/gtest.h" 21 | 22 | #include "storage/FileManagerLocal.hpp" 23 | #include "storage/tests/FileManager_unittest_common.hpp" 24 | 25 | QUICKSTEP_TEST_FILEMANAGER_IMPL(FileManagerLocal); 26 | -------------------------------------------------------------------------------- /storage/tests/LinearOpenAddressingHashTable_unittest.cpp: -------------------------------------------------------------------------------- 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | **/ 19 | 20 | #include "gtest/gtest.h" 21 | 22 | #include "storage/LinearOpenAddressingHashTable.hpp" 23 | #include "storage/tests/HashTable_unittest_common.hpp" 24 | 25 | QUICKSTEP_TEST_HASHTABLE_IMPL(LinearOpenAddressingHashTable); 26 | -------------------------------------------------------------------------------- /storage/tests/SeparateChainingHashTable_unittest.cpp: -------------------------------------------------------------------------------- 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | **/ 19 | 20 | #include "gtest/gtest.h" 21 | 22 | #include "storage/SeparateChainingHashTable.hpp" 23 | #include "storage/tests/HashTable_unittest_common.hpp" 24 | 25 | QUICKSTEP_TEST_HASHTABLE_IMPL(SeparateChainingHashTable); 26 | -------------------------------------------------------------------------------- /storage/tests/SimpleScalarSeparateChainingHashTable_unittest.cpp: -------------------------------------------------------------------------------- 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | **/ 19 | 20 | #include "gtest/gtest.h" 21 | 22 | #include "storage/SimpleScalarSeparateChainingHashTable.hpp" 23 | #include "storage/tests/HashTable_unittest_common.hpp" 24 | #include "storage/tests/StorageTestConfig.h" 25 | 26 | #ifdef QUICKSTEP_LONG_HASH_REVERSIBLE 27 | QUICKSTEP_TEST_HASHTABLE_IMPL_LONG_ONLY(SimpleScalarSeparateChainingHashTable); 28 | #endif // QUICKSTEP_LONG_HASH_REVERSIBLE 29 | -------------------------------------------------------------------------------- /storage/tests/StorageTestConfig.h.in: -------------------------------------------------------------------------------- 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | **/ 19 | 20 | #cmakedefine QUICKSTEP_LONG_HASH_REVERSIBLE 21 | -------------------------------------------------------------------------------- /third_party/README.md: -------------------------------------------------------------------------------- 1 | # Third-Party Libraries 2 | 3 | This directory includes various open-source third-party code that is used by 4 | Quickstep. Here's the description of the files: 5 | 6 | `download_and_patch_prerequisites.sh` - Downloads the third party library source codes from their respective repositories and applies Quickstep specific patches.
7 | `reset_third_party_dir.sh` - Removes the downloaded and patched third party and resets the `third_party` directory.
8 | `patches/` - Contains the patch files applied on the original third party source code files.
9 | `src/` - Contains the patched third party source code.
10 | 11 | With the exception of the code in the `tmb`, `iwyu`, and the `protobuf_cmake` 12 | directories (which are part of the Quickstep project itself), all other libraries 13 | belong to their original authors and are governed by their respective licenses. 14 | -------------------------------------------------------------------------------- /third_party/patches/benchmark/CMakeLists.patch: -------------------------------------------------------------------------------- 1 | --- CMakeLists.txt 2017-12-27 13:11:46.000000002 -0600 2 | +++ CMakeLists.txt.new 2017-12-27 13:12:28.000000002 -0600 3 | @@ -11,7 +11,7 @@ 4 | endif() 5 | endforeach() 6 | 7 | -option(BENCHMARK_ENABLE_TESTING "Enable testing of the benchmark library." ON) 8 | +option(BENCHMARK_ENABLE_TESTING "Enable testing of the benchmark library." OFF) 9 | option(BENCHMARK_ENABLE_EXCEPTIONS "Enable the use of exceptions in the benchmark library." ON) 10 | option(BENCHMARK_ENABLE_LTO "Enable link time optimisation of the benchmark library." OFF) 11 | option(BENCHMARK_USE_LIBCXX "Build and test using libc++ as the standard library." OFF) 12 | -------------------------------------------------------------------------------- /third_party/patches/gflags/CMakeLists.patch: -------------------------------------------------------------------------------- 1 | --- CMakeLists.txt 2017-01-28 12:35:08.000000000 -0800 2 | +++ CMakeLists.txt.new 2017-01-28 15:30:07.000000000 -0800 3 | @@ -206,6 +206,18 @@ 4 | "\nor disable the build of the multi-threaded gflags library (BUILD_gflags_LIB=OFF).") 5 | endif () 6 | 7 | +if(CMAKE_COMPILER_IS_GNUCXX) 8 | + CHECK_CXX_COMPILER_FLAG("-Wno-unused-local-typedefs" COMPILER_HAS_WNO_UNUSED_LOCAL_TYPEDEFS) 9 | + if (COMPILER_HAS_WNO_UNUSED_LOCAL_TYPEDEFS) 10 | + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-local-typedefs") 11 | + endif (COMPILER_HAS_WNO_UNUSED_LOCAL_TYPEDEFS) 12 | +elseif(${CMAKE_CXX_COMPILER_ID} MATCHES "Clang") 13 | + CHECK_CXX_COMPILER_FLAG("-Wno-unused-local-typedef" COMPILER_HAS_WNO_UNUSED_LOCAL_TYPEDEF) 14 | + if (COMPILER_HAS_WNO_UNUSED_LOCAL_TYPEDEF) 15 | + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-local-typedef") 16 | + endif (COMPILER_HAS_WNO_UNUSED_LOCAL_TYPEDEF) 17 | +endif () 18 | + 19 | # ---------------------------------------------------------------------------- 20 | # source files - excluding root subdirectory and/or .in suffix 21 | set (PUBLIC_HDRS 22 | -------------------------------------------------------------------------------- /third_party/patches/gflags/gflags_reporting.cc.patch: -------------------------------------------------------------------------------- 1 | 129c129 2 | < assert(chars_left == strlen(c_string)); // Unless there's a \0 in there? 3 | --- 4 | > assert(static_cast(chars_left) == strlen(c_string)); // Unless there's a \0 in there? 5 | -------------------------------------------------------------------------------- /third_party/patches/glog/glogCMakeLists.txt.patch: -------------------------------------------------------------------------------- 1 | --- CMakeLists.txt 2017-12-15 14:10:23.000000002 -0600 2 | +++ CMakeLists-new.txt 2017-12-15 14:07:52.000000002 -0600 3 | @@ -26,7 +26,7 @@ 4 | set (CPACK_PACKAGE_VERSION_PATCH ${GLOG_PATCH_VERSION}) 5 | set (CPACK_PACKAGE_VERSION ${GLOG_VERSION}) 6 | 7 | -option (WITH_GFLAGS "Use gflags" ON) 8 | +option (WITH_GFLAGS "Use gflags" OFF) 9 | option (WITH_THREADS "Enable multithreading support" ON) 10 | 11 | list (APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake) 12 | @@ -377,6 +377,11 @@ 13 | 14 | add_compile_options ($<$:-Wno-unnamed-type-template-args>) 15 | 16 | +CHECK_CXX_COMPILER_FLAG("-Wno-sign-compare" COMPILER_HAS_WNO_SIGN_ERROR) 17 | +if (COMPILER_HAS_WNO_SIGN_ERROR) 18 | + add_compile_options(-Wno-sign-compare) 19 | +endif() 20 | + 21 | add_library (glog 22 | ${GLOG_SRCS} 23 | ) 24 | -------------------------------------------------------------------------------- /third_party/patches/glog/utilities.cc.patch: -------------------------------------------------------------------------------- 1 | --- utilities.cc 2017-12-15 14:10:40.000000002 -0600 2 | +++ utilities.cc.new 2017-12-15 14:08:13.000000002 -0600 3 | @@ -300,7 +300,7 @@ 4 | g_my_user_name = "invalid-user"; 5 | } 6 | } 7 | -REGISTER_MODULE_INITIALIZER(utilities, MyUserNameInitializer()); 8 | +REGISTER_MODULE_INITIALIZER(utilities, MyUserNameInitializer()) 9 | 10 | #ifdef HAVE_STACKTRACE 11 | void DumpStackTraceToString(string* stacktrace) { 12 | -------------------------------------------------------------------------------- /third_party/patches/linenoise/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(linenoise linenoise.c) 2 | -------------------------------------------------------------------------------- /third_party/patches/linenoise/linenoise.h.patch: -------------------------------------------------------------------------------- 1 | --- linenoise.h.new 2015-04-13 02:38:43.000000000 -0500 2 | +++ linenoise.h 2017-02-21 09:44:05.000000000 -0600 3 | @@ -1,7 +1,5 @@ 4 | -/* linenoise.h -- VERSION 1.0 5 | - * 6 | - * Guerrilla line editing library against the idea that a line editing lib 7 | - * needs to be 20,000 lines of C code. 8 | +/* linenoise.h -- guerrilla line editing library against the idea that a 9 | + * line editing lib needs to be 20,000 lines of C code. 10 | * 11 | * See linenoise.c for more information. 12 | * 13 | @@ -36,9 +34,16 @@ 14 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15 | */ 16 | 17 | +/* Modified from original by Craig Chasseur as follows: 18 | + * - include stddef.h in header for size_t 19 | + * - do not trim newlines from end of input 20 | + */ 21 | + 22 | #ifndef __LINENOISE_H 23 | #define __LINENOISE_H 24 | 25 | +#include 26 | + 27 | #ifdef __cplusplus 28 | extern "C" { 29 | #endif 30 | -------------------------------------------------------------------------------- /third_party/reset_third_party_dir.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 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, 14 | # software distributed under the License is distributed on an 15 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | # KIND, either express or implied. See the License for the 17 | # specific language governing permissions and limitations 18 | # under the License. 19 | 20 | THIRD_PARTY_DIR=`pwd` 21 | if [ "${PWD##*/}" != "third_party" ]; then 22 | echo "ERROR: This script can be run only from the third party directory" 23 | exit 1 24 | fi 25 | 26 | THIRD_PARTY_SRC_DIR=${THIRD_PARTY_DIR}/src 27 | cd ${THIRD_PARTY_SRC_DIR} 28 | 29 | third_party_dir_names=("benchmark" 30 | "gflags" 31 | "googletest" 32 | "linenoise" 33 | "re2" 34 | "gperftools" 35 | "glog" 36 | ) 37 | 38 | for ((lib_index=0; lib_index < ${#third_party_dir_names[*]}; lib_index++)) 39 | do 40 | rm -rf ${third_party_dir_names[lib_index]}/ 41 | done 42 | -------------------------------------------------------------------------------- /third_party/src/farmhash/COPYING: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Google, Inc. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /third_party/src/farmhash/NEWS: -------------------------------------------------------------------------------- 1 | FarmHash v1.1, March 1, 2015 2 | 3 | * Added a new 64-bit hash function (namespace farmhashte) that is 4 | substantially faster for long strings. It requires SSE4.1. If 5 | AVX instructions are available then it should be slightly faster (e.g., 6 | use g++ -mavx). 7 | * Added a 32-bit hash function trivially derived from the above. Useful 8 | on CPUs with SSE4.1 or AVX. 9 | * Added new 64-bit hash functions derived from FarmHash v1.0 10 | (namespaces farmhashuo and farmhashxo). My testing suggests that for 11 | some string lengths these are speedier than the old standby (farmhashna). 12 | * Compiling with FARMHASH_NO_BUILTIN_EXPECT defined will now eliminate 13 | FarmHash's usage of __builtin_expect. Thanks to Cory Riddell for 14 | suggesting this. 15 | * Improved some comments, the README, etc. 16 | 17 | FarmHash v1.0, March 31, 2014 18 | 19 | * Initial release 20 | -------------------------------------------------------------------------------- /third_party/src/farmhash/farm-test.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 Google, Inc. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | // 21 | // FarmHash, by Geoff Pike 22 | 23 | // 24 | // FarmHash, by Geoff Pike 25 | 26 | // Compiling farmhash.cc with FARMHASHSELFTEST to 1 causes self-test 27 | // code to run at program startup. 28 | #define FARMHASHSELFTEST 1 29 | 30 | // Turn off DebugTweak() and similar. 31 | #define FARMHASH_DEBUG 0 32 | 33 | // Make it easy to detect unavailable functions by forcing them to return 0. 34 | #define FARMHASH_DIE_IF_MISCONFIGURED do { return 0; } while (0) 35 | 36 | #include "farmhash.cc" 37 | 38 | int main() {} 39 | -------------------------------------------------------------------------------- /third_party/src/iwyu/Darwin.imp: -------------------------------------------------------------------------------- 1 | [ 2 | { include: [ "@<_types/.*\\.h>", private, "", public ] }, 3 | { include: [ "@", private, "", public ] }, 4 | { symbol: [ "std::move", private, "", public ] }, 5 | { symbol: [ "std::isxdigit", private, "", public ] }, 6 | { symbol: [ "std::string", private, "", public ] }, 7 | { symbol: [ "std::hash", private, "", public ] }, 8 | { symbol: [ "std::vector", private, "", public ] }, 9 | { symbol: [ "std::unordered_map", private, "", public ] }, 10 | ] 11 | -------------------------------------------------------------------------------- /third_party/src/iwyu/sample_iwyu_conf.py: -------------------------------------------------------------------------------- 1 | # This is a regular python file which is loaded by the helper script. It then 2 | # looks for the CONFIG object. CONFIG object is a dict, which can optionally 3 | # contain three entries which are lists: 'system-includes', 'user-includes', 4 | # 'mappings', and one entry 'ignore-defaults' if set to True will make the help 5 | # ignore the default system includes, user includes, and mappings in the helper 6 | # and will use the ones defined here (otherwise these configurations will be 7 | # added to default configuration). 8 | 9 | # Paths can be relative to quickstep directory (starting with './'), or 10 | # absolute (starting with '/'). 11 | CONFIG = { 12 | # List of system includes. IWYU does not pick up system includes correctly 13 | # some times. 14 | 'system-includes': [ 15 | '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include', 16 | '/home/user/local/include', 17 | ], 18 | 19 | # List of user includes. IWYU does not pick up system includes correctly 20 | # some times. 21 | 'user-includes': [ 22 | './build/third_party/protobuf/include', 23 | ], 24 | 25 | # List of IWYU mappings to use. See include-what-you-use documentation for 26 | # format and need for mappings. 27 | 'mappings': [ 28 | 'obscure-platform.imp', 29 | ], 30 | 31 | # List of custom compiler args like defines. 32 | 'args': [ 33 | '-DQUICKSTEP_DEBUG', 34 | ], 35 | 36 | # Boolean (defaults to False) make the helper ignore default configurations. 37 | 'ignore-defaults': True, 38 | } 39 | -------------------------------------------------------------------------------- /third_party/src/tmb/.gitignore: -------------------------------------------------------------------------------- 1 | /html 2 | /latex 3 | *~ 4 | .DS_Store 5 | -------------------------------------------------------------------------------- /third_party/src/tmb/README.md: -------------------------------------------------------------------------------- 1 | # Transactional Message Busses 2 | 3 | Transactional Message Busses (TMB) are a reusable software library for scalable, 4 | reliable communication both within a process and across a distributed system. 5 | TMB is part of the Quickstep project and is distributed under the same license 6 | terms. 7 | -------------------------------------------------------------------------------- /third_party/src/tmb/benchmarks/include/tmbbench/affinity.h: -------------------------------------------------------------------------------- 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, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | #ifndef TMBBENCH_AFFINITY_H_ 19 | #define TMBBENCH_AFFINITY_H_ 20 | 21 | #include 22 | #include 23 | 24 | namespace tmbbench { 25 | 26 | bool ParseAffinityString(const std::string &affinity_string, 27 | std::vector> *affinities); 28 | 29 | bool ParseGlobalAffinityString(const std::string &affinity_string, 30 | std::vector *affinities); 31 | 32 | } // namespace tmbbench 33 | 34 | #endif // TMBBENCH_AFFINITY_H_ 35 | -------------------------------------------------------------------------------- /third_party/src/tmb/benchmarks/include/tmbbench/messages.h: -------------------------------------------------------------------------------- 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, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | #ifndef TMBBENCH_MESSAGES_H_ 19 | #define TMBBENCH_MESSAGES_H_ 20 | 21 | #include 22 | #include 23 | 24 | namespace tmbbench { 25 | 26 | static constexpr std::size_t kPoisonMessage 27 | = std::numeric_limits::max(); 28 | 29 | struct RunDescription { 30 | int num_senders; 31 | int num_receivers; 32 | std::size_t message_bytes; 33 | bool delete_immediately; 34 | }; 35 | 36 | struct ThroughputResult { 37 | double send_throughput; 38 | double receive_throughput; 39 | }; 40 | 41 | } // namespace tmbbench 42 | 43 | #endif // TMBBENCH_MESSAGES_H_ 44 | -------------------------------------------------------------------------------- /third_party/src/tmb/benchmarks/src/reset_bus.cc: -------------------------------------------------------------------------------- 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, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | #include 19 | #include 20 | 21 | #include "gflags/gflags.h" 22 | #include "tmb/message_bus.h" 23 | #include "tmbbench/bus_setup.h" 24 | 25 | int main(int argc, char *argv[]) { 26 | gflags::ParseCommandLineFlags(&argc, &argv, true); 27 | if (argc != 1) { 28 | std::cerr << "Unrecognized command-line arguments.\n"; 29 | return 1; 30 | } 31 | 32 | std::unique_ptr message_bus( 33 | tmbbench::SetupBusAllInOneDistributed()); 34 | if (!message_bus) { 35 | return 1; 36 | } 37 | 38 | message_bus->ResetBus(); 39 | return 0; 40 | } 41 | -------------------------------------------------------------------------------- /third_party/src/tmb/cmake/FindLevelDB.cmake: -------------------------------------------------------------------------------- 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, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | # Module to find LevelDB. 19 | 20 | find_path(LEVELDB_INCLUDE_DIR leveldb/db.h) 21 | 22 | find_library(LEVELDB_LIBRARY NAMES leveldb libleveldb) 23 | 24 | set(LEVELDB_LIBRARIES ${LEVELDB_LIBRARY}) 25 | set(LEVELDB_INCLUDE_DIRS ${LEVELDB_INCLUDE_DIR}) 26 | 27 | include(FindPackageHandleStandardArgs) 28 | find_package_handle_standard_args(LevelDB DEFAULT_MSG 29 | LEVELDB_LIBRARY LEVELDB_INCLUDE_DIR) 30 | 31 | mark_as_advanced(LEVELDB_INCLUDE_DIR LEVELDB_LIBRARY) 32 | -------------------------------------------------------------------------------- /third_party/src/tmb/cmake/FindProtobuf3.cmake: -------------------------------------------------------------------------------- 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, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | # Module to find Protocol Buffers supporting proto3 syntax. 19 | 20 | # Specifically look for map.h, which is a new header for the proto3 syntax. 21 | find_path(PROTOBUF3_INCLUDE_DIR google/protobuf/map.h) 22 | 23 | find_library(PROTOBUF3_LIBRARY 24 | NAMES protobuf libprotobuf 25 | HINTS ${PROTOBUF3_INCLUDE_DIR}/../lib 26 | ${PROTOBUF3_INCLUDE_DIR}/../lib64 27 | ${PROTOBUF3_INCLUDE_DIR}/../lib32) 28 | 29 | find_program(PROTOBUF3_PROTOC_EXECUTABLE 30 | NAMES protoc 31 | HINTS ${PROTOBUF3_INCLUDE_DIR}/../bin) 32 | 33 | set(PROTOBUF3_LIBRARIES ${PROTOBUF3_LIBRARY}) 34 | set(PROTOBUF3_INCLUDE_DIRS ${PROTOBUF3_INCLUDE_DIR}) 35 | 36 | include(FindPackageHandleStandardArgs) 37 | find_package_handle_standard_args(Protobuf3 DEFAULT_MSG 38 | PROTOBUF3_LIBRARY PROTOBUF3_INCLUDE_DIR) 39 | 40 | mark_as_advanced(PROTOBUF3_INCLUDE_DIR PROTOBUF3_LIBRARY PROTOBUF3_PROTOC_EXECUTABLE) 41 | -------------------------------------------------------------------------------- /third_party/src/tmb/cmake/FindSQLite3.cmake: -------------------------------------------------------------------------------- 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, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | # Module to find SQLite 3. 19 | 20 | find_package(PkgConfig) 21 | pkg_check_modules(PC_SQLITE3 QUIET sqlite3) 22 | set(SQLITE3_DEFINITIONS ${PC_SQLITE3_CFLAGS_OTHER}) 23 | 24 | find_path(SQLITE3_INCLUDE_DIR sqlite3.h 25 | HINTS ${PC_SQLITE3_INCLUDEDIR} ${PC_SQLITE3_INCLUDE_DIRS}) 26 | 27 | find_library(SQLITE3_LIBRARY NAMES sqlite3 libsqlite3 28 | HINTS ${PC_SQLITE3_LIBDIR} ${PC_SQLITE3_LIBRARY_DIRS}) 29 | 30 | set(SQLITE3_LIBRARIES ${SQLITE3_LIBRARY}) 31 | set(SQLITE3_INCLUDE_DIRS ${SQLITE3_INCLUDE_DIR}) 32 | 33 | include(FindPackageHandleStandardArgs) 34 | find_package_handle_standard_args(SQLite3 DEFAULT_MSG 35 | SQLITE3_LIBRARY SQLITE3_INCLUDE_DIR) 36 | 37 | mark_as_advanced(SQLITE3_INCLUDE_DIR SQLITE3_LIBRARY) 38 | -------------------------------------------------------------------------------- /third_party/src/tmb/cmake/FindZookeeper.cmake: -------------------------------------------------------------------------------- 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, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | # Module to find Zookeeper C Binding. 19 | 20 | find_path(ZOOKEEPER_INCLUDE_DIR zookeeper/zookeeper.h) 21 | 22 | find_library(ZOOKEEPER_LIBRARY NAMES zookeeper_mt libzookeeper_mt) 23 | 24 | set(ZOOKEEPER_LIBRARIES ${ZOOKEEPER_LIBRARY}) 25 | set(ZOOKEEPER_INCLUDE_DIRS ${ZOOKEEPER_INCLUDE_DIR}) 26 | 27 | include(FindPackageHandleStandardArgs) 28 | find_package_handle_standard_args(Zookeeper DEFAULT_MSG 29 | ZOOKEEPER_LIBRARY ZOOKEEPER_INCLUDE_DIR) 30 | 31 | mark_as_advanced(ZOOKEEPER_INCLUDE_DIR ZOOKEEPER_LIBRARY) 32 | -------------------------------------------------------------------------------- /third_party/src/tmb/include/tmb/internal/log_read_status.h: -------------------------------------------------------------------------------- 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | **/ 19 | 20 | #ifndef TMB_INTERNAL_LOG_READ_STATUS_H_ 21 | #define TMB_INTERNAL_LOG_READ_STATUS_H_ 22 | 23 | namespace tmb { 24 | namespace internal { 25 | 26 | /** 27 | * @brief Codes indicating different possible results of a ReadNextRecord() 28 | * call. 29 | **/ 30 | enum class LogReadStatus { 31 | kOK, 32 | kEndOfFile, 33 | kIoError, 34 | kTruncatedRecord, 35 | // NOTE(chasseur): kOversizeRecord usually means that garbage bytes in a 36 | // record header were interpreted as some huge length (> kMaxLogRecordSize). 37 | // Unless the log has been corrupted, it is NOT expected that any good 38 | // records will follow an oversize record. 39 | kOversizeRecord, 40 | kChecksumFailed 41 | }; 42 | 43 | } // namespace internal 44 | } // namespace tmb 45 | 46 | #endif // TMB_INTERNAL_LOG_READ_STATUS_H_ 47 | -------------------------------------------------------------------------------- /third_party/src/tmb/include/tmb/internal/log_reader_base.h: -------------------------------------------------------------------------------- 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | **/ 19 | 20 | #ifndef TMB_INTERNAL_LOG_READER_BASE_H_ 21 | #define TMB_INTERNAL_LOG_READER_BASE_H_ 22 | 23 | namespace tmb { 24 | namespace internal { 25 | 26 | /** 27 | * @brief Common base class with virtual destructor for LogReaderPosix and 28 | * LogReaderStdio. 29 | **/ 30 | class LogReaderBase { 31 | public: 32 | LogReaderBase() { 33 | } 34 | 35 | virtual ~LogReaderBase() { 36 | } 37 | 38 | private: 39 | // Disallow copy and assign: 40 | LogReaderBase(const LogReaderBase &orig) = delete; 41 | LogReaderBase& operator=(const LogReaderBase &rhs) = delete; 42 | }; 43 | 44 | } // namespace internal 45 | } // namespace tmb 46 | 47 | #endif // TMB_INTERNAL_LOG_READER_BASE_H_ 48 | -------------------------------------------------------------------------------- /third_party/src/tmb/include/tmb/internal/log_record_header.h: -------------------------------------------------------------------------------- 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | **/ 19 | 20 | #ifndef TMB_INTERNAL_LOG_RECORD_HEADER_H_ 21 | #define TMB_INTERNAL_LOG_RECORD_HEADER_H_ 22 | 23 | #include 24 | #include 25 | 26 | namespace tmb { 27 | namespace internal { 28 | 29 | // Header for all log records written by LogWriter and read by LogReader. 30 | struct LogRecordHeader { 31 | std::size_t length; 32 | std::uint32_t crc32; 33 | }; 34 | 35 | } // namespace internal 36 | } // namespace tmb 37 | 38 | #endif // TMB_INTERNAL_LOG_RECORD_HEADER_H_ 39 | -------------------------------------------------------------------------------- /third_party/src/tmb/include/tmb/internal/log_writer_base.h: -------------------------------------------------------------------------------- 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | **/ 19 | 20 | #ifndef TMB_INTERNAL_LOG_WRITER_BASE_H_ 21 | #define TMB_INTERNAL_LOG_WRITER_BASE_H_ 22 | 23 | namespace tmb { 24 | namespace internal { 25 | 26 | /** 27 | * @brief Common base class with virtual destructor for LogWriterPosix and 28 | * LogWriterStdio. 29 | **/ 30 | class LogWriterBase { 31 | public: 32 | LogWriterBase() { 33 | } 34 | 35 | virtual ~LogWriterBase() { 36 | } 37 | 38 | private: 39 | // Disallow copy and assign: 40 | LogWriterBase(const LogWriterBase &orig) = delete; 41 | LogWriterBase& operator=(const LogWriterBase &rhs) = delete; 42 | }; 43 | 44 | } // namespace internal 45 | } // namespace tmb 46 | 47 | #endif // TMB_INTERNAL_LOG_WRITER_BASE_H_ 48 | -------------------------------------------------------------------------------- /third_party/src/tmb/include/tmb/internal/message_metadata.h: -------------------------------------------------------------------------------- 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | **/ 19 | 20 | #ifndef TMB_INTERNAL_MESSAGE_METADATA_H_ 21 | #define TMB_INTERNAL_MESSAGE_METADATA_H_ 22 | 23 | #include // NOLINT(build/c++11) 24 | 25 | #include "tmb/id_typedefs.h" 26 | 27 | namespace tmb { 28 | namespace internal { 29 | 30 | // Metadata which is appended to the end of message contents stored in LevelDB 31 | // and Zookeeper. 32 | struct MessageMetadata { 33 | message_type_id message_type; 34 | client_id sender; 35 | std::chrono::time_point send_time; 36 | }; 37 | 38 | } // namespace internal 39 | } // namespace tmb 40 | 41 | #endif // TMB_INTERNAL_MESSAGE_METADATA_H_ 42 | -------------------------------------------------------------------------------- /third_party/src/tmb/include/tmb/internal/zookeeper_format.h: -------------------------------------------------------------------------------- 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | **/ 19 | 20 | #ifndef TMB_INTERNAL_ZOOKEEPER_FORMAT_H_ 21 | #define TMB_INTERNAL_ZOOKEEPER_FORMAT_H_ 22 | 23 | #include // NOLINT(build/c++11) 24 | #include 25 | #include 26 | 27 | namespace tmb { 28 | namespace internal { 29 | 30 | constexpr static std::size_t kZookeeperTickDigits = std::numeric_limits< 31 | std::chrono::time_point 32 | ::duration::rep>::digits10 + 2; 33 | 34 | constexpr static std::size_t kZookeeperQueuedMessageNameLength 35 | = 3 // Priority 36 | + 1 // "-" 37 | + kZookeeperTickDigits // Expiration time 38 | + 1 // "-" 39 | + 10 // Message ID 40 | + 1; // Null-terminator 41 | 42 | } // namespace internal 43 | } // namespace tmb 44 | 45 | #endif // TMB_INTERNAL_ZOOKEEPER_FORMAT_H_ 46 | -------------------------------------------------------------------------------- /third_party/src/tmb/src/java/ConnectClient.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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | **/ 19 | 20 | package tmb.voltdb; 21 | 22 | import org.voltdb.*; 23 | 24 | public class ConnectClient extends VoltProcedure { 25 | public final SQLStmt insertClientSQL = new SQLStmt( 26 | "INSERT INTO client VALUES (?, NOW, NULL);"); 27 | 28 | public long run() throws VoltAbortException { 29 | // Generate a probable unique client ID by XORing the high and low parts of 30 | // the transaction ID together. 31 | long tx_id = getUniqueId(); 32 | int client_id = (int)tx_id ^ (int)(tx_id >>> 32); 33 | 34 | voltQueueSQL(insertClientSQL, client_id); 35 | voltExecuteSQL(); 36 | 37 | return client_id; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /third_party/src/tmb/src/java/DeleteMessages.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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | **/ 19 | 20 | package tmb.voltdb; 21 | 22 | import org.voltdb.*; 23 | 24 | public class DeleteMessages extends VoltProcedure { 25 | public final SQLStmt deleteQueuedMessageSQL = new SQLStmt( 26 | "DELETE FROM queued_message WHERE receiver_id = ? AND message_id = ?"); 27 | public final SQLStmt deleteExpiredMessagesSQL = new SQLStmt( 28 | "DELETE FROM queued_message WHERE NOW > expiration_time;"); 29 | 30 | public long run(int receiver_id, 31 | long[] message_ids) throws VoltAbortException { 32 | for (long message_id : message_ids) { 33 | voltQueueSQL(deleteQueuedMessageSQL, receiver_id, message_id); 34 | } 35 | // Delete all expired messages in this partition while we're at it. 36 | voltQueueSQL(deleteExpiredMessagesSQL); 37 | voltExecuteSQL(); 38 | return 0; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /third_party/src/tmb/src/java/DeleteMessagesUnchecked.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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | **/ 19 | 20 | package tmb.voltdb; 21 | 22 | import org.voltdb.*; 23 | 24 | public class DeleteMessagesUnchecked extends VoltProcedure { 25 | public final SQLStmt deleteQueuedMessageSQL = new SQLStmt( 26 | "DELETE FROM queued_message WHERE receiver_id = ? AND message_id = ?"); 27 | 28 | public long run(int receiver_id, 29 | long[] message_ids) throws VoltAbortException { 30 | for (long message_id : message_ids) { 31 | voltQueueSQL(deleteQueuedMessageSQL, receiver_id, message_id); 32 | } 33 | voltExecuteSQL(); 34 | return 0; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /third_party/src/tmb/src/java/RegisterReceiver.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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | **/ 19 | 20 | package tmb.voltdb; 21 | 22 | import org.voltdb.*; 23 | 24 | public class RegisterReceiver extends VoltProcedure { 25 | public final SQLStmt checkConnectedSQL = new SQLStmt( 26 | "SELECT client_id FROM client WHERE client_id = ? " 27 | + "AND disconnect_time IS NULL"); 28 | public final SQLStmt insertReceivableSQL = new SQLStmt( 29 | "INSERT INTO receivable VALUES(?, ?);"); 30 | 31 | public long run(int client_id, 32 | int message_type_id) throws VoltAbortException { 33 | voltQueueSQL(checkConnectedSQL, EXPECT_ONE_ROW, client_id); 34 | voltQueueSQL(insertReceivableSQL, client_id, message_type_id); 35 | voltExecuteSQL(); 36 | 37 | return 0; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /third_party/src/tmb/src/java/RegisterSender.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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | **/ 19 | 20 | package tmb.voltdb; 21 | 22 | import org.voltdb.*; 23 | 24 | public class RegisterSender extends VoltProcedure { 25 | public final SQLStmt checkConnectedSQL = new SQLStmt( 26 | "SELECT client_id FROM client WHERE client_id = ? " 27 | + "AND disconnect_time IS NULL"); 28 | public final SQLStmt insertSendableSQL = new SQLStmt( 29 | "INSERT INTO sendable VALUES(?, ?);"); 30 | 31 | public long run(int client_id, 32 | int message_type_id) throws VoltAbortException { 33 | voltQueueSQL(checkConnectedSQL, EXPECT_ONE_ROW, client_id); 34 | voltQueueSQL(insertSendableSQL, client_id, message_type_id); 35 | voltExecuteSQL(); 36 | 37 | return 0; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /third_party/src/tmb/src/java/ResetBus.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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | **/ 19 | 20 | package tmb.voltdb; 21 | 22 | import org.voltdb.*; 23 | 24 | public class ResetBus extends VoltProcedure { 25 | public final SQLStmt deleteClientsSQL = new SQLStmt("DELETE FROM client;"); 26 | public final SQLStmt deleteSendableSQL = new SQLStmt( 27 | "DELETE FROM sendable;"); 28 | public final SQLStmt deleteReceivableSQL = new SQLStmt( 29 | "DELETE FROM receivable;"); 30 | public final SQLStmt deleteCancellableMessagesSQL = new SQLStmt( 31 | "DELETE FROM cancellable_message;"); 32 | public final SQLStmt deleteQueuedMessagesSQL = new SQLStmt( 33 | "DELETE FROM queued_message;"); 34 | 35 | public long run() throws VoltAbortException { 36 | voltQueueSQL(deleteClientsSQL); 37 | voltQueueSQL(deleteSendableSQL); 38 | voltQueueSQL(deleteReceivableSQL); 39 | voltQueueSQL(deleteCancellableMessagesSQL); 40 | voltQueueSQL(deleteQueuedMessagesSQL); 41 | voltExecuteSQL(); 42 | 43 | return 0; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /third_party/src/tmb/tests/pure_memory_message_bus_unittest.cc: -------------------------------------------------------------------------------- 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | **/ 19 | 20 | #include "gtest/gtest.h" 21 | #include "tests/message_bus_unittest_common.h" 22 | #include "tmb/pure_memory_message_bus.h" 23 | 24 | namespace tmb { 25 | 26 | typedef ::testing::Types, 27 | PureMemoryMessageBus> TestTypes; 28 | INSTANTIATE_TYPED_TEST_CASE_P(PureMemory, MessageBusTest, TestTypes); 29 | 30 | typedef ::testing::Types> DeletionTestTypes; 31 | INSTANTIATE_TYPED_TEST_CASE_P(PureMemory, 32 | SeparateDeletionMessageBusTest, 33 | DeletionTestTypes); 34 | 35 | } // namespace tmb 36 | -------------------------------------------------------------------------------- /threading/ConditionVariable.cpp: -------------------------------------------------------------------------------- 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | **/ 19 | 20 | #include "threading/ConditionVariable.hpp" 21 | 22 | namespace quickstep { 23 | 24 | ConditionVariableInterface::~ConditionVariableInterface() {} 25 | 26 | } // namespace quickstep 27 | -------------------------------------------------------------------------------- /threading/Mutex.cpp: -------------------------------------------------------------------------------- 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | **/ 19 | 20 | #include "threading/Mutex.hpp" 21 | 22 | namespace quickstep { 23 | 24 | // Strange but true: C++ requires pure-virtual destructors to have a definition. 25 | 26 | MutexInterface::~MutexInterface() {} 27 | MutexLockInterface::~MutexLockInterface() {} 28 | 29 | } // namespace quickstep 30 | -------------------------------------------------------------------------------- /threading/Thread.cpp: -------------------------------------------------------------------------------- 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | **/ 19 | 20 | #include "threading/Thread.hpp" 21 | 22 | #include 23 | 24 | namespace quickstep { 25 | 26 | ThreadInterface::~ThreadInterface() {} 27 | 28 | namespace threading_internal { 29 | void executeRunMethodForThreadReturnNothing(void *thread_ptr) { 30 | static_cast(thread_ptr)->run(); 31 | } 32 | 33 | void *executeRunMethodForThreadReturnNull(void *thread_ptr) { 34 | static_cast(thread_ptr)->run(); 35 | return NULL; 36 | } 37 | } // namespace threading_internal 38 | 39 | } // namespace quickstep 40 | -------------------------------------------------------------------------------- /threading/ThreadingConfig.h.in: -------------------------------------------------------------------------------- 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | **/ 19 | 20 | #cmakedefine QUICKSTEP_HAVE_CPP11_THREADS 21 | #cmakedefine QUICKSTEP_HAVE_POSIX_THREADS 22 | #cmakedefine QUICKSTEP_HAVE_WINDOWS_THREADS 23 | #cmakedefine QUICKSTEP_HAVE_CPP14_SHARED_TIMED_MUTEX 24 | #cmakedefine QUICKSTEP_HAVE_CPP17_SHARED_MUTEX 25 | 26 | #cmakedefine QUICKSTEP_HAVE_CPP11_YIELD 27 | #cmakedefine QUICKSTEP_HAVE_SCHED_YIELD 28 | #cmakedefine QUICKSTEP_HAVE_PTHREAD_YIELD 29 | #cmakedefine QUICKSTEP_HAVE_WIN_SWITCHTOTHREAD 30 | 31 | #cmakedefine QUICKSTEP_HAVE_PTHREAD_SETAFFINITY_NP_LINUX 32 | #cmakedefine QUICKSTEP_HAVE_PTHREAD_SETAFFINITY_NP_FREEBSD 33 | #cmakedefine QUICKSTEP_HAVE_PTHREAD_SETAFFINITY_NP_NETBSD 34 | -------------------------------------------------------------------------------- /threading/ThreadingModule.hpp: -------------------------------------------------------------------------------- 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | **/ 19 | 20 | /** @defgroup Threading 21 | * 22 | * Quickstep's threading module, which transparently provides a cross-platform 23 | * interface to threading facilities provided by the host system. 24 | **/ 25 | -------------------------------------------------------------------------------- /transaction/AccessMode.cpp: -------------------------------------------------------------------------------- 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | **/ 19 | 20 | #include "AccessMode.hpp" 21 | 22 | namespace quickstep { 23 | namespace transaction { 24 | 25 | const bool AccessMode::kLockCompatibilityMatrix[kNumberLocks][kNumberLocks] = { 26 | /* NL IS IX S SIX X */ 27 | /* NL */ {true , true , true , true , true , true }, 28 | /* IS */ {true , true , true , true , true , false}, 29 | /* IX */ {true , true , true , false, false, false}, 30 | /* S */ {true , true , false, true , false, false}, 31 | /* SIX */ {true , true , false, false, false, false}, 32 | /* X */ {true , false, false, false, false, false} 33 | }; 34 | 35 | } // namespace transaction 36 | } // namespace quickstep 37 | -------------------------------------------------------------------------------- /transaction/TransactionModule.hpp: -------------------------------------------------------------------------------- 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | **/ 19 | 20 | /** 21 | * @defgroup Transaction 22 | * 23 | * The Quickstep transaction system. 24 | **/ 25 | -------------------------------------------------------------------------------- /types/Type.proto: -------------------------------------------------------------------------------- 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, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | syntax = "proto2"; 19 | 20 | package quickstep.serialization; 21 | 22 | message Type { 23 | enum TypeID { 24 | INT = 0; 25 | LONG = 1; 26 | FLOAT = 2; 27 | DOUBLE = 3; 28 | CHAR = 4; 29 | VAR_CHAR = 5; 30 | DATETIME = 6; 31 | DATETIME_INTERVAL = 7; 32 | YEAR_MONTH_INTERVAL = 8; 33 | NULL_TYPE = 9; 34 | DATE = 10; 35 | } 36 | 37 | required TypeID type_id = 1; 38 | required bool nullable = 2; 39 | 40 | // The convention for extension numbering is that extensions for a particular 41 | // TypeID should begin from (type_id + 1) * 32. 42 | extensions 32 to max; 43 | } 44 | 45 | message CharType { 46 | extend Type { 47 | // Required when type_id == CHAR. 48 | optional uint64 length = 160; 49 | } 50 | } 51 | 52 | message VarCharType { 53 | extend Type { 54 | // Required when type_id == VAR_CHAR. 55 | optional uint64 length = 192; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /types/TypeID.cpp: -------------------------------------------------------------------------------- 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | **/ 19 | 20 | #include "types/TypeID.hpp" 21 | 22 | namespace quickstep { 23 | 24 | const char *kTypeNames[] = { 25 | "Int", 26 | "Long", 27 | "Float", 28 | "Double", 29 | "Char", 30 | "VarChar", 31 | "Date", 32 | "Datetime", 33 | "DatetimeInterval", 34 | "YearMonthInterval", 35 | "NullType" 36 | }; 37 | 38 | } // namespace quickstep 39 | -------------------------------------------------------------------------------- /types/TypedValue.proto: -------------------------------------------------------------------------------- 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, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | syntax = "proto2"; 19 | 20 | package quickstep.serialization; 21 | 22 | import "types/Type.proto"; 23 | 24 | message TypedValue { 25 | required Type.TypeID type_id = 1; 26 | 27 | // NOTE(zuyu): For a NULL value, none of the optional fields are filled in. 28 | optional int32 int_value = 2; 29 | optional int64 long_value = 3; 30 | optional float float_value = 4; 31 | optional double double_value = 5; 32 | optional bytes out_of_line_data = 6; 33 | optional int64 datetime_value = 7; 34 | optional int64 datetime_interval_value = 8; 35 | optional int64 year_month_interval_value = 9; 36 | 37 | message DateLit { 38 | required int32 year = 1; 39 | required uint32 month = 2; 40 | required uint32 day = 3; 41 | } 42 | 43 | optional DateLit date_value = 10; 44 | } 45 | -------------------------------------------------------------------------------- /types/TypesModule.hpp: -------------------------------------------------------------------------------- 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | **/ 19 | 20 | /** @defgroup Types 21 | * 22 | * The quickstep type system, an extensible framework for data types and 23 | * operations on typed data. 24 | **/ 25 | -------------------------------------------------------------------------------- /types/containers/ColumnVector.cpp: -------------------------------------------------------------------------------- 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | **/ 19 | 20 | #include "types/containers/ColumnVector.hpp" 21 | 22 | #include 23 | 24 | namespace quickstep { 25 | 26 | class Type; 27 | class TypedValue; 28 | 29 | ColumnVector* ColumnVector::MakeVectorOfValue( 30 | const Type &value_type, 31 | const TypedValue &value, 32 | const std::size_t num_copies) { 33 | if (NativeColumnVector::UsableForType(value_type)) { 34 | NativeColumnVector *result = new NativeColumnVector(value_type, num_copies); 35 | result->fillWithValue(value); 36 | return result; 37 | } else { 38 | IndirectColumnVector *result = new IndirectColumnVector(value_type, num_copies); 39 | result->fillWithValue(value); 40 | return result; 41 | } 42 | } 43 | 44 | } // namespace quickstep 45 | -------------------------------------------------------------------------------- /types/containers/Tuple.proto: -------------------------------------------------------------------------------- 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, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | syntax = "proto2"; 19 | 20 | package quickstep.serialization; 21 | 22 | import "types/TypedValue.proto"; 23 | 24 | message Tuple { 25 | repeated TypedValue attribute_values = 1; 26 | } 27 | -------------------------------------------------------------------------------- /types/operations/Operation.cpp: -------------------------------------------------------------------------------- 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | **/ 19 | 20 | #include "types/operations/Operation.hpp" 21 | 22 | namespace quickstep { 23 | 24 | const char *Operation::kOperationSuperTypeNames[] = { 25 | "Comparison", 26 | "UnaryOperation", 27 | "BinaryOperation" 28 | }; 29 | 30 | } // namespace quickstep 31 | -------------------------------------------------------------------------------- /types/operations/binary_operations/BinaryOperationID.cpp: -------------------------------------------------------------------------------- 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | **/ 19 | 20 | #include "types/operations/binary_operations/BinaryOperationID.hpp" 21 | 22 | namespace quickstep { 23 | 24 | const char *kBinaryOperationNames[] = { 25 | "Add", 26 | "Subtract", 27 | "Multiply", 28 | "Divide", 29 | "Modulo" 30 | }; 31 | 32 | const char *kBinaryOperationShortNames[] = { 33 | "+", 34 | "-", 35 | "*", 36 | "/", 37 | "%" 38 | }; 39 | 40 | } // namespace quickstep 41 | -------------------------------------------------------------------------------- /types/operations/comparisons/ComparisonID.cpp: -------------------------------------------------------------------------------- 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | **/ 19 | 20 | #include "types/operations/comparisons/ComparisonID.hpp" 21 | 22 | namespace quickstep { 23 | 24 | const char *kComparisonNames[] = { 25 | "Equal", 26 | "NotEqual", 27 | "Less", 28 | "LessOrEqual", 29 | "Greater", 30 | "GreaterOrEqual", 31 | "Like", 32 | "NotLike", 33 | "RegexMatch", 34 | "NotRegexMatch" 35 | }; 36 | 37 | const char *kComparisonShortNames[] = { 38 | "=", 39 | "!=", 40 | "<", 41 | "<=", 42 | ">", 43 | ">=", 44 | "LIKE", 45 | "NOT LIKE", 46 | "REGEXP", 47 | "NOT REGEXP" 48 | }; 49 | 50 | } // namespace quickstep 51 | -------------------------------------------------------------------------------- /types/operations/unary_operations/UnaryOperationID.cpp: -------------------------------------------------------------------------------- 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | **/ 19 | 20 | #include "types/operations/unary_operations/UnaryOperationID.hpp" 21 | 22 | namespace quickstep { 23 | 24 | const char *kUnaryOperationNames[] = { 25 | "Negate", "Cast", "DateExtract", "Substring" 26 | }; 27 | 28 | const char *kUnaryOperationShortNames[] = { 29 | "-", "Cast", "DateExtract", "Substring" 30 | }; 31 | 32 | } // namespace quickstep 33 | -------------------------------------------------------------------------------- /types/port/TypesPortConfig.h.in: -------------------------------------------------------------------------------- 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | **/ 19 | 20 | #cmakedefine QUICKSTEP_HAVE_GMTIME_R 21 | #cmakedefine QUICKSTEP_HAVE_GMTIME_S 22 | #cmakedefine QUICKSTEP_HAVE_LOCALTIME_R 23 | #cmakedefine QUICKSTEP_HAVE_LOCALTIME_S 24 | #cmakedefine QUICKSTEP_HAVE_SETENV 25 | #cmakedefine QUICKSTEP_HAVE_STRNLEN 26 | #cmakedefine QUICKSTEP_HAVE_TIMEGM 27 | #cmakedefine QUICKSTEP_HAVE_TZSET 28 | -------------------------------------------------------------------------------- /types/port/gmtime_r.hpp: -------------------------------------------------------------------------------- 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | **/ 19 | 20 | #ifndef QUICKSTEP_TYPES_PORT_GMTIME_R_HPP_ 21 | #define QUICKSTEP_TYPES_PORT_GMTIME_R_HPP_ 22 | 23 | #include 24 | 25 | #include "types/port/TypesPortConfig.h" 26 | #include "utility/Macros.hpp" 27 | 28 | namespace quickstep { 29 | 30 | #if defined(QUICKSTEP_HAVE_GMTIME_R) 31 | inline struct tm* gmtime_r(const std::time_t *timep, struct tm *result) { 32 | return ::gmtime_r(timep, result); 33 | } 34 | #elif defined(QUICKSTEP_HAVE_GMTIME_S) 35 | inline struct tm* gmtime_r(const std::time_t *timep, struct tm *result) { 36 | DO_AND_DEBUG_ASSERT_ZERO(gmtime_s(result, timep)); 37 | return result; 38 | } 39 | #endif 40 | 41 | } // namespace quickstep 42 | 43 | #endif // QUICKSTEP_TYPES_PORT_GMTIME_R_HPP_ 44 | -------------------------------------------------------------------------------- /types/port/localtime_r.hpp: -------------------------------------------------------------------------------- 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | **/ 19 | 20 | #ifndef QUICKSTEP_TYPES_PORT_LOCALTIME_R_HPP_ 21 | #define QUICKSTEP_TYPES_PORT_LOCALTIME_R_HPP_ 22 | 23 | #include 24 | 25 | #include "types/port/TypesPortConfig.h" 26 | #include "utility/Macros.hpp" 27 | 28 | namespace quickstep { 29 | 30 | #if defined(QUICKSTEP_HAVE_LOCALTIME_R) 31 | inline struct tm* localtime_r(const std::time_t *timep, struct tm *result) { 32 | return ::localtime_r(timep, result); 33 | } 34 | #elif defined(QUICKSTEP_HAVE_LOCALTIME_S) 35 | inline struct tm* localtime_r(const std::time_t *timep, struct tm *result) { 36 | DO_AND_DEBUG_ASSERT_ZERO(localtime_s(result, timep)); 37 | return result; 38 | } 39 | #endif 40 | 41 | } // namespace quickstep 42 | 43 | #endif // QUICKSTEP_TYPES_PORT_LOCALTIME_R_HPP_ 44 | -------------------------------------------------------------------------------- /types/port/strnlen.hpp: -------------------------------------------------------------------------------- 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | **/ 19 | 20 | #ifndef QUICKSTEP_TYPES_PORT_STRNLEN_HPP_ 21 | #define QUICKSTEP_TYPES_PORT_STRNLEN_HPP_ 22 | 23 | #include 24 | #include 25 | 26 | #include "types/port/TypesPortConfig.h" 27 | 28 | namespace quickstep { 29 | 30 | /** \addtogroup Types 31 | * @{ 32 | */ 33 | 34 | #ifdef QUICKSTEP_HAVE_STRNLEN 35 | inline std::size_t strnlen(const char *c, const std::size_t maxlen) { 36 | return ::strnlen(c, maxlen); 37 | } 38 | #else 39 | inline std::size_t strnlen(const char *c, const std::size_t maxlen) { 40 | const char *loc = static_cast(std::memchr(c, '\0', maxlen)); 41 | if (loc == nullptr) { 42 | return maxlen; 43 | } else { 44 | return (loc - c); 45 | } 46 | } 47 | #endif 48 | 49 | /** @} */ 50 | 51 | } // namespace quickstep 52 | 53 | #endif // QUICKSTEP_TYPES_PORT_STRNLEN_HPP_ 54 | -------------------------------------------------------------------------------- /utility/BloomFilter.proto: -------------------------------------------------------------------------------- 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, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | syntax = "proto2"; 19 | 20 | package quickstep.serialization; 21 | 22 | message BloomFilter { 23 | // The default values were determined from empirical experiments. 24 | // These values control the amount of false positivity that 25 | // is expected from Bloom Filter. 26 | // - Default seed for initializing family of hashes = 0xA5A5A5A55A5A5A5A. 27 | // - Default bloom filter size = 10 KB. 28 | // - Default number of hash functions used in bloom filter = 5. 29 | optional fixed64 bloom_filter_seed = 1 [default = 0xA5A5A5A55A5A5A5A]; 30 | optional uint32 bloom_filter_size = 2 [default = 10000]; 31 | optional uint32 number_of_hashes = 3 [default = 5]; 32 | } 33 | -------------------------------------------------------------------------------- /utility/BulkIoConfiguration.cpp: -------------------------------------------------------------------------------- 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | **/ 19 | 20 | #include "utility/BulkIoConfiguration.hpp" 21 | 22 | #include "glog/logging.h" 23 | 24 | namespace quickstep { 25 | 26 | void BulkIoConfiguration::initializeDefaultParameters(const BulkIoFormat format) { 27 | switch (format) { 28 | case BulkIoFormat::kCsv: { 29 | delimiter_ = ','; 30 | escape_strings_ = false; 31 | header_ = true; 32 | quote_ = '"'; 33 | null_string_ = ""; 34 | break; 35 | } 36 | case BulkIoFormat::kText: { 37 | delimiter_ = '\t'; 38 | escape_strings_ = true; 39 | header_ = false; 40 | quote_ = 0; 41 | null_string_ = "\\N"; 42 | break; 43 | } 44 | default: 45 | LOG(FATAL) << "Unexpected format in " 46 | << "BulkIoConfiguration::initializeDefaultParameters()"; 47 | } 48 | } 49 | 50 | } // namespace quickstep 51 | -------------------------------------------------------------------------------- /utility/CalculateInstalledMemory.hpp: -------------------------------------------------------------------------------- 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | **/ 19 | 20 | #ifndef QUICKSTEP_UTILITY_SYSTEM_CALCULATE_INSTALLED_MEMORY_HPP_ 21 | #define QUICKSTEP_UTILITY_SYSTEM_CALCULATE_INSTALLED_MEMORY_HPP_ 22 | 23 | #include 24 | 25 | namespace quickstep { 26 | namespace utility { 27 | namespace system { 28 | 29 | /** 30 | * @brief Compute the amount of (DRAM) memory installed on the machine. 31 | * @param total_memory Returns the total installed system memory in bytes. 32 | * @return true on success, false otherwise. 33 | */ 34 | bool calculateTotalMemoryInBytes(std::uint64_t *total_memory); 35 | 36 | } // namespace system 37 | } // namespace utility 38 | } // namespace quickstep 39 | 40 | #endif // QUICKSTEP_UTILITY_SYSTEM_CALCULATE_INSTALLED_MEMORY_HPP_ 41 | -------------------------------------------------------------------------------- /utility/CompositeHash.hpp: -------------------------------------------------------------------------------- 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | **/ 19 | 20 | #ifndef QUICKSTEP_UTILITY_COMPOSITE_HASH_HPP_ 21 | #define QUICKSTEP_UTILITY_COMPOSITE_HASH_HPP_ 22 | 23 | #include 24 | #include 25 | 26 | #include "types/TypedValue.hpp" 27 | #include "utility/HashPair.hpp" 28 | 29 | #include "glog/logging.h" 30 | 31 | namespace quickstep { 32 | 33 | /** 34 | * @brief Compute the hash value of a composite key. 35 | * 36 | * @param key A vector of TypedValues which together form the composite key. 37 | * @return The hash value. 38 | **/ 39 | static std::size_t HashCompositeKey(const std::vector &key) { 40 | DCHECK(!key.empty()); 41 | std::size_t hash = key.front().getHash(); 42 | for (std::vector::const_iterator key_it = key.begin() + 1; 43 | key_it != key.end(); 44 | ++key_it) { 45 | hash = CombineHashes(hash, key_it->getHash()); 46 | } 47 | return hash; 48 | } 49 | 50 | } // namespace quickstep 51 | 52 | #endif // QUICKSTEP_UTILITY_COMPOSITE_HASH_HPP_ 53 | -------------------------------------------------------------------------------- /utility/HashError.hpp: -------------------------------------------------------------------------------- 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | **/ 19 | 20 | #ifndef QUICKSTEP_UTILITY_HASH_ERROR_HPP_ 21 | #define QUICKSTEP_UTILITY_HASH_ERROR_HPP_ 22 | 23 | #include 24 | #include 25 | 26 | namespace quickstep { 27 | 28 | /** \addtogroup Utility 29 | * @{ 30 | */ 31 | 32 | /** 33 | * @brief Exception thrown for non-supported hash(). 34 | **/ 35 | class HashNotSupported : public std::exception { 36 | public: 37 | /** 38 | * @brief Constructor. 39 | * 40 | * @param message The error message. 41 | **/ 42 | explicit HashNotSupported(const std::string &message) 43 | : message_(message) {} 44 | 45 | /** 46 | * @brief Destructor. 47 | */ 48 | ~HashNotSupported() throw() {} 49 | 50 | virtual const char* what() const throw() { 51 | return message_.c_str(); 52 | } 53 | 54 | private: 55 | const std::string message_; 56 | }; 57 | 58 | /** @} */ 59 | 60 | } // namespace quickstep 61 | 62 | #endif // QUICKSTEP_UTILITY_HASH_ERROR_HPP_ 63 | -------------------------------------------------------------------------------- /utility/NetworkUtil.hpp: -------------------------------------------------------------------------------- 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | **/ 19 | 20 | #ifndef QUICKSTEP_UTILITY_NETWORK_UTIL_HPP_ 21 | #define QUICKSTEP_UTILITY_NETWORK_UTIL_HPP_ 22 | 23 | #include 24 | 25 | namespace quickstep { 26 | 27 | /** \addtogroup Utility 28 | * @{ 29 | */ 30 | 31 | constexpr char kLocalIpv4Address[] = "127.0.0.1"; 32 | 33 | /** 34 | * @brief Get the IPv4 network address in the text format, i.e., "127.0.0.1". 35 | */ 36 | extern std::string GetIpv4Address(); 37 | 38 | /** @} */ 39 | 40 | } // namespace quickstep 41 | 42 | #endif // QUICKSTEP_UTILITY_NETWORK_UTIL_HPP_ 43 | -------------------------------------------------------------------------------- /utility/SortConfiguration.proto: -------------------------------------------------------------------------------- 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, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | syntax = "proto2"; 19 | 20 | package quickstep.serialization; 21 | 22 | import "expressions/Expressions.proto"; 23 | 24 | message SortConfiguration { 25 | message OrderBy { 26 | required Scalar expression = 1; 27 | required bool is_ascending = 2; 28 | required bool null_first = 3; 29 | } 30 | 31 | repeated OrderBy order_by_list = 1; 32 | } 33 | -------------------------------------------------------------------------------- /utility/UtilityConfig.h.in: -------------------------------------------------------------------------------- 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | **/ 19 | 20 | #cmakedefine QUICKSTEP_HAVE_ALIGNED_ALLOC 21 | #cmakedefine QUICKSTEP_HAVE_BUILTIN_POPCOUNT 22 | #cmakedefine QUICKSTEP_HAVE_BUILTIN_CLZ 23 | #cmakedefine QUICKSTEP_HAVE_BUILTIN_CTZ 24 | #cmakedefine QUICKSTEP_HAVE_GLOB 25 | #cmakedefine QUICKSTEP_HAVE_MEMALIGN 26 | #cmakedefine QUICKSTEP_HAVE_OPEN_MEMSTREAM 27 | #cmakedefine QUICKSTEP_HAVE_POSIX_MEMALIGN 28 | #cmakedefine QUICKSTEP_HAVE_STD_ALIGN 29 | #cmakedefine QUICKSTEP_HAVE_SYSCONF 30 | #cmakedefine QUICKSTEP_HAVE_TCMALLOC 31 | #cmakedefine QUICKSTEP_HAVE_WIN_ALIGNED_MALLOC 32 | #cmakedefine QUICKSTEP_HAVE_WINDOWS 33 | -------------------------------------------------------------------------------- /utility/UtilityModule.hpp: -------------------------------------------------------------------------------- 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | **/ 19 | 20 | /** @defgroup Utility 21 | * 22 | * Various general-purpose utility classes, functions, and macros used 23 | * throughout quickstep. 24 | **/ 25 | -------------------------------------------------------------------------------- /utility/VectorUtil.hpp: -------------------------------------------------------------------------------- 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | **/ 19 | 20 | #ifndef QUICKSTEP_UTILITY_VECTOR_UTIL_HPP_ 21 | #define QUICKSTEP_UTILITY_VECTOR_UTIL_HPP_ 22 | 23 | #include 24 | 25 | namespace quickstep { 26 | 27 | /** \addtogroup Utility 28 | * @{ 29 | */ 30 | 31 | /** 32 | * @brief Adds a new element \p item to a vector \p list if the element does not exist. 33 | * 34 | * @param item The element to be inserted to the vector. 35 | * @param vec The vector to be appended to. 36 | * @return True if the element is inserted. 37 | */ 38 | template 39 | bool AppendToVectorIfNotPresent(const Type &item, std::vector *vec) { 40 | for (const Type &exist_item : *vec) { 41 | if (exist_item == item) { 42 | return false; 43 | } 44 | } 45 | vec->push_back(item); 46 | return true; 47 | } 48 | 49 | /** @} */ 50 | 51 | } // namespace quickstep 52 | 53 | #endif /* QUICKSTEP_UTILITY_VECTOR_UTIL_HPP_ */ 54 | -------------------------------------------------------------------------------- /utility/tests/CalculateInstalledMemory_unittest.cpp: -------------------------------------------------------------------------------- 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | **/ 19 | 20 | #include 21 | #include 22 | #include 23 | 24 | #include "gtest/gtest.h" 25 | #include "utility/CalculateInstalledMemory.hpp" 26 | 27 | namespace quickstep { 28 | namespace utility { 29 | namespace system { 30 | 31 | TEST(CalculateInstalledMemoryTest, BasicCheck) { 32 | std::uint64_t installed_memory_in_bytes; 33 | 34 | EXPECT_EQ(true, calculateTotalMemoryInBytes(&installed_memory_in_bytes)); 35 | EXPECT_GT(installed_memory_in_bytes, 0u); 36 | } 37 | 38 | } // namespace system 39 | } // namespace utility 40 | } // namespace quickstep 41 | -------------------------------------------------------------------------------- /utility/tests/HashPair_benchmark.cpp: -------------------------------------------------------------------------------- 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | **/ 19 | 20 | #include 21 | #include 22 | 23 | #include "utility/HashPair.hpp" 24 | 25 | #include "benchmark/benchmark.h" 26 | 27 | static void BM_HashDouble(benchmark::State &state) { // NOLINT(runtime/references) 28 | struct std::hash h; 29 | double value = 0.42; 30 | while (state.KeepRunning()) { 31 | h(value); 32 | } 33 | } 34 | BENCHMARK(BM_HashDouble); 35 | 36 | static void BM_HashPairDoubleDouble(benchmark::State &state) { // NOLINT(runtime/references) 37 | struct std::hash> h; 38 | std::pair pair = std::make_pair(0.42, 0.42); 39 | while (state.KeepRunning()) { 40 | h(pair); 41 | } 42 | } 43 | BENCHMARK(BM_HashPairDoubleDouble); 44 | 45 | int main(int argc, char **argv) { 46 | benchmark::Initialize(&argc, argv); 47 | benchmark::RunSpecifiedBenchmarks(); 48 | return 0; 49 | } 50 | -------------------------------------------------------------------------------- /utility/tests/NetworkUtil_unittest.cpp: -------------------------------------------------------------------------------- 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | **/ 19 | 20 | #include 21 | 22 | #include "utility/NetworkUtil.hpp" 23 | 24 | #include "gflags/gflags_declare.h" 25 | #include "gtest/gtest.h" 26 | 27 | using std::string; 28 | 29 | namespace quickstep { 30 | 31 | DECLARE_bool(use_ethernet_ip); 32 | 33 | TEST(NetworkUtilTest, LoopbackTest) { 34 | string lo_ip_address = GetIpv4Address(); 35 | EXPECT_STREQ(kLocalIpv4Address, lo_ip_address.c_str()); 36 | } 37 | 38 | TEST(NetworkUtilTest, EthernetTest) { 39 | FLAGS_use_ethernet_ip = true; 40 | string ethernet_ip_address = GetIpv4Address(); 41 | EXPECT_STRNE(kLocalIpv4Address, ethernet_ip_address.c_str()); 42 | } 43 | 44 | } // namespace quickstep 45 | -------------------------------------------------------------------------------- /utility/textbased_test/TextBasedTest.cpp: -------------------------------------------------------------------------------- 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | **/ 19 | 20 | #include "utility/textbased_test/TextBasedTest.hpp" 21 | 22 | #include "utility/textbased_test/TextBasedTestRunner.hpp" 23 | 24 | #include "gtest/gtest.h" 25 | 26 | namespace quickstep { 27 | 28 | TEST_P(TextBasedTest, CompareOutputs) { 29 | test_case_->test_runner->runTestCase(test_case_->input_text, test_case_->options, &test_case_->actual_output_text); 30 | EXPECT_EQ(test_case_->expected_output_text, test_case_->actual_output_text); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /yarn/CMakeLists.txt: -------------------------------------------------------------------------------- 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, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | option(ENABLE_YARN "Enable optional support for Quickstep on YARN" OFF) 19 | --------------------------------------------------------------------------------