├── .github ├── dependabot.yml └── workflows │ ├── dotnet-core.yml │ └── release.yml ├── .gitignore ├── LICENSE ├── README.md ├── TestData └── tpch │ ├── customer.csv │ ├── lineitem.csv │ ├── nation.csv │ ├── orders.csv │ ├── part.csv │ ├── partsupp.csv │ ├── region.csv │ └── supplier.csv ├── docs ├── .vscode │ └── settings.json ├── Makefile ├── make.bat └── source │ ├── authorization.rst │ ├── conf.py │ ├── configuration.rst │ ├── contributor │ └── addingtype.rst │ ├── contributordocs.rst │ ├── datatypes.rst │ ├── entityframeworkclient.rst │ ├── gettingstarted.rst │ ├── index.rst │ ├── indexsupport.rst │ ├── inmemorydata.rst │ ├── joins.rst │ ├── parameters.rst │ ├── searchfunctionality.rst │ ├── sql.rst │ ├── sql │ └── functions.rst │ └── trinoconnector.rst ├── netcore ├── .dockerignore ├── .netconfig ├── Koralium.sln ├── Koralium.sln.licenseheader ├── coverlet.runsettings ├── src │ ├── Koralium.Core │ │ ├── Builders │ │ │ ├── KoraliumBuilder.cs │ │ │ └── TableResolverBuilder.cs │ │ ├── Extensions │ │ │ ├── ServiceCollectionExtensions.cs │ │ │ └── TableResolverBuilderExtensions.cs │ │ ├── Interfaces │ │ │ ├── ICustomMetadata.cs │ │ │ ├── IDiscoveryService.cs │ │ │ ├── IKoraliumBuilder.cs │ │ │ ├── ITableResolver.cs │ │ │ └── ITableResolverBuilder.cs │ │ ├── Koralium.Core.csproj │ │ ├── KoraliumTransportService.cs │ │ ├── Metadata │ │ │ ├── CustomMetadataStore.cs │ │ │ ├── KoraliumTable.cs │ │ │ ├── MetadataStore.cs │ │ │ ├── TableColumn.cs │ │ │ └── TableIndex.cs │ │ ├── Models │ │ │ ├── ServiceLoction.cs │ │ │ └── TableResolverData.cs │ │ ├── Partitions │ │ │ ├── Partition.cs │ │ │ ├── PartitionBuilder.cs │ │ │ ├── PartitionFilterVisitor.cs │ │ │ ├── PartitionOptions.cs │ │ │ └── PartitionsBuilder.cs │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ ├── README.md │ │ ├── Resolvers │ │ │ ├── DefaultPartitionResolver.cs │ │ │ ├── PartitionResolver.cs │ │ │ ├── SqlTableResolver.cs │ │ │ └── TableResolver.cs │ │ ├── RowLevelSecurity │ │ │ ├── AddAliasVisitor.cs │ │ │ ├── AddFilterVisitor.cs │ │ │ ├── LocateFilterVisitor.cs │ │ │ ├── RowLevelSecurityContext.cs │ │ │ ├── RowLevelSecurityHelper.cs │ │ │ └── TableLocatorVisitor.cs │ │ ├── Services │ │ │ ├── DefaultDiscoveryService.cs │ │ │ └── PartitionHostedService.cs │ │ └── Utils │ │ │ ├── AuthorizationHelper.cs │ │ │ ├── CircularDependencyHelper.cs │ │ │ ├── ColumnTypeHelper.cs │ │ │ └── MetadataHelper.cs │ ├── Koralium.Data.ArrowFlight │ │ ├── DataReaders │ │ │ ├── FlightEndpointsDataReader.cs │ │ │ ├── ReadErrorDataReader.cs │ │ │ └── UnsafeRecordBatchDataReader.cs │ │ ├── Decoders │ │ │ ├── BinaryDecoder.cs │ │ │ ├── BoolDecoder.cs │ │ │ ├── ColumnDecoder.cs │ │ │ ├── Decimal128Decoder.cs │ │ │ ├── DoubleDecoder.cs │ │ │ ├── EnumDecoder.cs │ │ │ ├── FloatDecoder.cs │ │ │ ├── Int16Decoder.cs │ │ │ ├── Int32Decoder.cs │ │ │ ├── Int64Decoder.cs │ │ │ ├── Int8Decoder.cs │ │ │ ├── ListDecoder.cs │ │ │ ├── NullDecoder.cs │ │ │ ├── PrimitiveDecoder.cs │ │ │ ├── StringDecoder.cs │ │ │ ├── StructDecoder.cs │ │ │ ├── TimestampDecoder.cs │ │ │ ├── UInt32Decoder.cs │ │ │ ├── UInt64Decoder.cs │ │ │ └── UInt8Decoder.cs │ │ ├── Internal │ │ │ ├── AsyncHelper.cs │ │ │ └── TypeDecoderVisitor.cs │ │ ├── Koralium.Data.ArrowFlight.csproj │ │ ├── KoraliumCommand.cs │ │ ├── KoraliumConnection.cs │ │ ├── KoraliumConnectionStringBuilder.cs │ │ ├── KoraliumFactory.cs │ │ ├── KoraliumParameter.cs │ │ ├── KoraliumParameterCollection.cs │ │ ├── KoraliumTransaction.cs │ │ ├── Properties │ │ │ ├── Resources.Designer.cs │ │ │ ├── Resources.Designer.tt │ │ │ └── Resources.resx │ │ └── Utils │ │ │ ├── GenericListCreator.cs │ │ │ ├── ListCreator.cs │ │ │ ├── ListCreatorFactory.cs │ │ │ ├── ListCreators.cs │ │ │ ├── PropertyAccessor.cs │ │ │ ├── SchemaToDecoder.cs │ │ │ ├── TypeAccessor.cs │ │ │ └── TypeAccessors.cs │ ├── Koralium.EntityFrameworkCore.ArrowFlight │ │ ├── Diagnostics │ │ │ └── Internal │ │ │ │ └── KoraliumLoggingDefinitions.cs │ │ ├── Extensions │ │ │ ├── KoraliumDbContextOptionsBuilderExtensions.cs │ │ │ ├── KoraliumPropertyBuilderExtensions.cs │ │ │ └── KoraliumServiceCollectionExtensions.cs │ │ ├── Infrastructure │ │ │ ├── Internal │ │ │ │ └── KoraliumOptionsExtension.cs │ │ │ └── KoraliumDbContextOptionsBuilder.cs │ │ ├── Koralium.EntityFrameworkCore.ArrowFlight.csproj │ │ ├── Query │ │ │ ├── Internal │ │ │ │ ├── KoraliumLambdaVisitor.cs │ │ │ │ ├── KoraliumQuerySqlGenerator.cs │ │ │ │ ├── KoraliumQuerySqlGeneratorFactory.cs │ │ │ │ ├── KoraliumQueryableMethodTranslatingExpressionVisitor.cs │ │ │ │ ├── KoraliumQueryableMethodTranslatingExpressionVisitorFactory.cs │ │ │ │ ├── KoraliumSqlTranslatingExpressionVisitor.cs │ │ │ │ └── KoraliumSqlTranslatingExpressionVisitorFactory.cs │ │ │ └── SqlExpressions │ │ │ │ └── SqlLambdaExpression.cs │ │ ├── Storage │ │ │ └── Internal │ │ │ │ ├── EnumTypeMapping.cs │ │ │ │ ├── KoraliumDateTimeTypeMapping.cs │ │ │ │ ├── KoraliumRelationalConnection.cs │ │ │ │ ├── KoraliumSqlGenerationHelper.cs │ │ │ │ ├── KoraliumStringTypeMapping.cs │ │ │ │ ├── KoraliumTypeMappingSource.cs │ │ │ │ ├── ListTypeMapping.cs │ │ │ │ └── ObjectTypeMapping.cs │ │ └── Update │ │ │ └── Internal │ │ │ ├── KoraliumModificationCommandBatchFactory.cs │ │ │ └── KoraliumUpdateSqlGenerator.cs │ ├── Koralium.Shared │ │ ├── Attributes │ │ │ ├── ColumnNameAttribute.cs │ │ │ └── KoraliumIgnoreAttribute.cs │ │ ├── Extensions │ │ │ └── LoggerExtensions.cs │ │ ├── IReadSqlParameters.cs │ │ ├── Koralium.Shared.csproj │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ ├── SqlErrorException.cs │ │ ├── SqlParameter.cs │ │ ├── SqlParameters.cs │ │ └── Utils │ │ │ ├── ArrayUtils.cs │ │ │ ├── EnumUtils.cs │ │ │ └── TypeConvertUtils.cs │ ├── Koralium.SqlParser.ANTLR │ │ ├── ANTLR │ │ │ ├── KoraliumLexer.g4 │ │ │ ├── KoraliumParser.g4 │ │ │ ├── antlr.jar │ │ │ ├── generate.bat │ │ │ └── generated │ │ │ │ ├── KoraliumLexer.cs │ │ │ │ ├── KoraliumLexer.interp │ │ │ │ ├── KoraliumLexer.tokens │ │ │ │ ├── KoraliumParser.cs │ │ │ │ ├── KoraliumParser.interp │ │ │ │ ├── KoraliumParser.tokens │ │ │ │ ├── KoraliumParserBaseListener.cs │ │ │ │ ├── KoraliumParserBaseVisitor.cs │ │ │ │ ├── KoraliumParserListener.cs │ │ │ │ └── KoraliumParserVisitor.cs │ │ ├── AntlrErrorListener.cs │ │ ├── AntlrSqlParser.cs │ │ ├── AntlrVisitor.cs │ │ ├── CaseChangingCharStream.cs │ │ └── Koralium.SqlParser.ANTLR.csproj │ ├── Koralium.SqlParser │ │ ├── Clauses │ │ │ ├── FromClause.cs │ │ │ ├── GroupByClause.cs │ │ │ ├── HavingClause.cs │ │ │ ├── OffsetLimitClause.cs │ │ │ ├── OrderByClause.cs │ │ │ └── WhereClause.cs │ │ ├── Errors │ │ │ └── SqlParserError.cs │ │ ├── Exceptions │ │ │ └── SqlParserException.cs │ │ ├── Expressions │ │ │ ├── BetweenExpression.cs │ │ │ ├── BinaryExpression.cs │ │ │ ├── BinaryType.cs │ │ │ ├── BooleanBinaryExpression.cs │ │ │ ├── BooleanBinaryType.cs │ │ │ ├── BooleanComparisonExpression.cs │ │ │ ├── BooleanComparisonType.cs │ │ │ ├── BooleanExpression.cs │ │ │ ├── BooleanIsNullExpression.cs │ │ │ ├── BooleanScalarExpression.cs │ │ │ ├── CastExpression.cs │ │ │ ├── ColumnReference.cs │ │ │ ├── FunctionCall.cs │ │ │ ├── InExpression.cs │ │ │ ├── LambdaExpression.cs │ │ │ ├── LikeExpression.cs │ │ │ ├── NotExpression.cs │ │ │ ├── ScalarExpression.cs │ │ │ ├── SearchExpression.cs │ │ │ ├── SelectExpression.cs │ │ │ ├── SelectNullExpression.cs │ │ │ ├── SelectScalarExpression.cs │ │ │ ├── SelectStarExpression.cs │ │ │ ├── SqlExpression.cs │ │ │ └── VariableReference.cs │ │ ├── Extensions │ │ │ ├── ListExtensions.cs │ │ │ └── SqlNodeExtensions.cs │ │ ├── From │ │ │ ├── FromTableReference.cs │ │ │ ├── Subquery.cs │ │ │ └── TableReference.cs │ │ ├── GroupBy │ │ │ ├── ExpressionGroup.cs │ │ │ ├── Group.cs │ │ │ └── SelectStatementGroup.cs │ │ ├── Interfaces │ │ │ └── ISqlParser.cs │ │ ├── Koralium.SqlParser.csproj │ │ ├── Literals │ │ │ ├── Base64Literal.cs │ │ │ ├── BooleanLiteral.cs │ │ │ ├── IntegerLiteral.cs │ │ │ ├── Literal.cs │ │ │ ├── NullLiteral.cs │ │ │ ├── NumericLiteral.cs │ │ │ └── StringLiteral.cs │ │ ├── OrderBy │ │ │ ├── OrderBySubquery.cs │ │ │ ├── OrderElement.cs │ │ │ └── OrderExpression.cs │ │ ├── QueryBuilder │ │ │ ├── FilterExpressionVisitor.cs │ │ │ ├── FilterUtils.cs │ │ │ ├── PartialEvaluator.cs │ │ │ └── QueryBuilder.cs │ │ ├── SqlNode.cs │ │ ├── Statements │ │ │ ├── SelectStatement.cs │ │ │ ├── SetVariableStatement.cs │ │ │ ├── Statement.cs │ │ │ └── StatementList.cs │ │ └── Visitor │ │ │ ├── KoraliumSqlVisitor.cs │ │ │ └── PrintVisitor.cs │ ├── Koralium.SqlToExpression │ │ ├── Executors │ │ │ ├── AggregateFunction │ │ │ │ ├── AggregateFunctionExecutor.cs │ │ │ │ ├── DefaultAggregateFunctionExecutor.cs │ │ │ │ ├── DefaultAggregateFunctionFactory.cs │ │ │ │ ├── IAggregateFunctionExecutor.cs │ │ │ │ ├── IAggregateFunctionExecutorFactory.cs │ │ │ │ └── ObjectExtensions.cs │ │ │ ├── Distinct │ │ │ │ ├── DefaultDistinctExecutor.cs │ │ │ │ ├── DefaultDistinctExecutorFactory.cs │ │ │ │ ├── DistinctExecutor.cs │ │ │ │ ├── IDistinctExecutor.cs │ │ │ │ └── IDistinctExecutorFactory.cs │ │ │ ├── FromTable │ │ │ │ ├── DefaultFromTableExecutor.cs │ │ │ │ ├── DefaultFromTableExecutorFactory.cs │ │ │ │ ├── FromTableExecutor.cs │ │ │ │ ├── IFromTableExecutor.cs │ │ │ │ └── IFromTableExecutorFactory.cs │ │ │ ├── GroupBy │ │ │ │ ├── DefaultGroupByExecutor.cs │ │ │ │ ├── DefaultGroupByExecutorFactory.cs │ │ │ │ ├── GroupByExecutor.cs │ │ │ │ ├── IGroupByExecutor.cs │ │ │ │ └── IGroupByExecutorFactory.cs │ │ │ ├── IQueryExecutor.cs │ │ │ ├── Offset │ │ │ │ ├── DefaultOffsetExecutor.cs │ │ │ │ ├── DefaultOffsetExecutorFactory.cs │ │ │ │ ├── IOffsetExecutor.cs │ │ │ │ ├── IOffsetExecutorFactory.cs │ │ │ │ └── OffsetExecutor.cs │ │ │ ├── OrderBy │ │ │ │ ├── DefaultOrderByExecutor.cs │ │ │ │ ├── DefaultOrderByExecutorFactory.cs │ │ │ │ ├── IOrderByExecutor.cs │ │ │ │ ├── IOrderByExecutorFactory.cs │ │ │ │ └── OrderByExecutor.cs │ │ │ ├── QueryExecutor.cs │ │ │ ├── Select │ │ │ │ ├── DefaultSelectExecutor.cs │ │ │ │ ├── DefaultSelectExecutorFactory.cs │ │ │ │ ├── ISelectExecutor.cs │ │ │ │ ├── ISelectExecutorFactory.cs │ │ │ │ ├── SelectExecutor.cs │ │ │ │ └── SelectResult.cs │ │ │ └── Where │ │ │ │ ├── DefaultWhereExecutor.cs │ │ │ │ ├── DefaultWhereExecutorFactory.cs │ │ │ │ ├── IWhereExecutor.cs │ │ │ │ ├── IWhereExecutorFactory.cs │ │ │ │ └── WhereExecutor.cs │ │ ├── Extensions │ │ │ ├── ExpressionExtensions.cs │ │ │ ├── ServiceCollectionExtensions.cs │ │ │ └── TypeExtensions.cs │ │ ├── Generated │ │ │ ├── AnonType.cs │ │ │ └── AnonType.tt │ │ ├── Indexing │ │ │ ├── IndexBuilderVisitor.cs │ │ │ └── IndexHelper.cs │ │ ├── Interfaces │ │ │ ├── IOperationsProvider.cs │ │ │ ├── IQueryOptions.cs │ │ │ ├── ISearchExpressionProvider.cs │ │ │ ├── ISearchParameters.cs │ │ │ └── ISqlTableResolver.cs │ │ ├── Koralium.SqlToExpression.csproj │ │ ├── Metadata │ │ │ ├── ColumnMetadata.cs │ │ │ ├── TableMetadata.cs │ │ │ └── TablesMetadata.cs │ │ ├── Models │ │ │ ├── AggregationType.cs │ │ │ ├── BinaryExpressionType.cs │ │ │ ├── BooleanComparisonType.cs │ │ │ ├── FromAliases.cs │ │ │ ├── SchemaResult.cs │ │ │ ├── SortItem.cs │ │ │ └── SqlTypeInfo.cs │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ ├── Providers │ │ │ ├── DefaultOperationsProvider.cs │ │ │ ├── DefaultSearchExpressionProvider.cs │ │ │ ├── InMemoryOperationsProvider.cs │ │ │ └── SearchParameters.cs │ │ ├── QueryOptions.cs │ │ ├── QueryResult.cs │ │ ├── SqlExecutor.cs │ │ ├── Stages │ │ │ ├── CompileStages │ │ │ │ ├── DistinctStage.cs │ │ │ │ ├── FromTableStage.cs │ │ │ │ ├── GroupByStage.cs │ │ │ │ ├── GroupedOrderByStage.cs │ │ │ │ ├── GroupedStage.cs │ │ │ │ ├── HavingStage.cs │ │ │ │ ├── IQueryStage.cs │ │ │ │ ├── IQueryStageVisitor.cs │ │ │ │ ├── OffsetStage.cs │ │ │ │ ├── OrderByStage.cs │ │ │ │ ├── SelectAggregateFunctionStage.cs │ │ │ │ ├── SelectStage.cs │ │ │ │ └── WhereStage.cs │ │ │ ├── ExecuteStages │ │ │ │ ├── ExecuteAggregateFunctionStage.cs │ │ │ │ ├── ExecuteDistinctStage.cs │ │ │ │ ├── ExecuteFromTableStage.cs │ │ │ │ ├── ExecuteGroupByStage.cs │ │ │ │ ├── ExecuteOffsetStage.cs │ │ │ │ ├── ExecuteOrderByStage.cs │ │ │ │ ├── ExecuteSelectStage.cs │ │ │ │ ├── ExecuteWhereStage.cs │ │ │ │ └── IExecuteStage.cs │ │ │ ├── SchemaCreatorVisitor.cs │ │ │ └── StageConverter.cs │ │ ├── Utils │ │ │ ├── AggregationUtils.cs │ │ │ ├── AnonTypeUtils.cs │ │ │ ├── ArrayFunctionUtils.cs │ │ │ ├── BinaryUtils.cs │ │ │ ├── GroupByUtils.cs │ │ │ ├── ListUtils.cs │ │ │ ├── MemberUtils.cs │ │ │ ├── NullableUtils.cs │ │ │ ├── OffsetLimitUtils.cs │ │ │ ├── PredicateUtils.cs │ │ │ └── SelectExpressionUtils.cs │ │ └── Visitors │ │ │ ├── Analyzers │ │ │ ├── ContainsAggregateAnalyzer.cs │ │ │ └── ContainsAggregateHelper.cs │ │ │ ├── BaseAggregationVisitor.cs │ │ │ ├── BaseVisitor.cs │ │ │ ├── Distinct │ │ │ └── DistinctHelper.cs │ │ │ ├── From │ │ │ ├── FromHelper.cs │ │ │ └── FromVisitor.cs │ │ │ ├── GroupBy │ │ │ ├── GroupByExpression.cs │ │ │ ├── GroupByHelper.cs │ │ │ └── GroupByVisitor.cs │ │ │ ├── Having │ │ │ ├── HavingHelper.cs │ │ │ └── HavingVisitor.cs │ │ │ ├── MainVisitor.cs │ │ │ ├── Offset │ │ │ ├── OffsetHelper.cs │ │ │ └── OffsetVisitor.cs │ │ │ ├── OrderBy │ │ │ ├── OrderByAggregationsVisitor.cs │ │ │ ├── OrderByHelper.cs │ │ │ └── OrderByPlainVisitor.cs │ │ │ ├── Select │ │ │ ├── ISelectVisitor.cs │ │ │ ├── SelectAggregationVisitor.cs │ │ │ ├── SelectExpression.cs │ │ │ ├── SelectHelper.cs │ │ │ ├── SelectPlainVisitor.cs │ │ │ └── SingleAggregateVisitor.cs │ │ │ ├── VisitorMetadata.cs │ │ │ └── Where │ │ │ ├── LikeVisitor.cs │ │ │ ├── WhereHelper.cs │ │ │ └── WhereVisitor.cs │ ├── Koralium.TestFramework │ │ ├── Koralium.TestFramework.csproj │ │ ├── QueryTest.cs │ │ ├── QueryTestAggregates.cs │ │ ├── QueryTestBase.cs │ │ ├── QueryTestFieldSelect.cs │ │ ├── QueryTestFilters.cs │ │ ├── QueryTestOrderBy.cs │ │ ├── TestCaseSourceGeneric.cs │ │ ├── TestContext.cs │ │ ├── TestContextSettings.cs │ │ └── TestFilterGenerator.cs │ ├── Koralium.Transport.ArrowFlight │ │ ├── Encoders │ │ │ ├── BinaryEncoder.cs │ │ │ ├── BooleanEncoder.cs │ │ │ ├── DateTimeEncoder.cs │ │ │ ├── Decimal128Encoder.cs │ │ │ ├── DoubleEncoder.cs │ │ │ ├── EnumEncoder.cs │ │ │ ├── FloatEncoder.cs │ │ │ ├── IArrowEncoder.cs │ │ │ ├── Int16Encoder.cs │ │ │ ├── Int32Encoder.cs │ │ │ ├── Int64Encoder.cs │ │ │ ├── ListEncoder.cs │ │ │ ├── ObjectEncoder.cs │ │ │ ├── StringEncoder.cs │ │ │ ├── UInt32Encoder.cs │ │ │ ├── UInt64Encoder.cs │ │ │ └── UInt8Encoder.cs │ │ ├── Extensions │ │ │ ├── KoraliumFlightEndpointRouteBuilderExtensions.cs │ │ │ └── KoraliumFlightGrpcServerBuilderExtensions.cs │ │ ├── Koralium.Transport.ArrowFlight.csproj │ │ ├── KoraliumFlightServer.cs │ │ └── Utils │ │ │ ├── EncoderHelper.cs │ │ │ └── TypeConverter.cs │ ├── Koralium.Transport.Json │ │ ├── Encoders │ │ │ ├── BinaryEncoder.cs │ │ │ ├── BooleanEncoder.cs │ │ │ ├── DateTimeEncoder.cs │ │ │ ├── Decimal128Encoder.cs │ │ │ ├── DoubleEncoder.cs │ │ │ ├── EncoderHelper.cs │ │ │ ├── EnumEncoder.cs │ │ │ ├── FloatEncoder.cs │ │ │ ├── IJsonEncoder.cs │ │ │ ├── Int16Encoder.cs │ │ │ ├── Int32Encoder.cs │ │ │ ├── Int64Encoder.cs │ │ │ ├── ListEncoder.cs │ │ │ ├── ObjectEncoder.cs │ │ │ ├── PrimitiveEncoder.cs │ │ │ ├── StringEncoder.cs │ │ │ ├── UInt32Encoder.cs │ │ │ ├── UInt64Encoder.cs │ │ │ └── UInt8Encoder.cs │ │ ├── Extensions │ │ │ └── KoraliumJsonEndpointRouteBuilderExtensions.cs │ │ ├── JsonExecutor.cs │ │ └── Koralium.Transport.Json.csproj │ ├── Koralium.Transport.LegacyGrpc.Abstractions │ │ ├── Koralium.Transport.LegacyGrpc.Abstractions.csproj │ │ └── Protos │ │ │ └── koralium.proto │ ├── Koralium.Transport.LegacyGrpc │ │ ├── Decoders │ │ │ ├── ParameterDecoder.cs │ │ │ └── ScalarDecoder.cs │ │ ├── Encoders │ │ │ ├── ArrayEncoder.cs │ │ │ ├── BoolEncoder.cs │ │ │ ├── DoubleEncoder.cs │ │ │ ├── FloatEncoder.cs │ │ │ ├── Int32Encoder.cs │ │ │ ├── Int64Encoder.cs │ │ │ ├── ObjectEncoder.cs │ │ │ ├── ScalarEncoder.cs │ │ │ ├── StringEncoder.cs │ │ │ └── TimestampEncoder.cs │ │ ├── Extensions │ │ │ ├── LegacyGrpcEndpointRouteBuilderExtensions.cs │ │ │ └── LegacyGrpcServiceCollectionExtensions.cs │ │ ├── Interfaces │ │ │ ├── IDecoder.cs │ │ │ └── IEncoder.cs │ │ ├── Koralium.Transport.LegacyGrpc.csproj │ │ ├── LegacyGrpcExecutor.cs │ │ ├── Services │ │ │ └── LegacyGrpcService.cs │ │ └── Utils │ │ │ ├── EncoderHelper.cs │ │ │ └── MetadataHelper.cs │ ├── Koralium.Transport.RowLevelSecurity │ │ ├── Extensions │ │ │ └── KoraliumRowLevelSecurityEndpointRouteBuilderExtensions.cs │ │ ├── FormatConverters │ │ │ ├── Cubejs │ │ │ │ ├── Converter │ │ │ │ │ └── CubejsVisitor.cs │ │ │ │ ├── CubejsFormat.cs │ │ │ │ ├── Models │ │ │ │ │ ├── BaseQueryFilter.cs │ │ │ │ │ ├── BinaryQueryFilter.cs │ │ │ │ │ ├── ComparisonOperator.cs │ │ │ │ │ └── QueryFilter.cs │ │ │ │ └── Serializers │ │ │ │ │ ├── BaseQueryFilterSerializer.cs │ │ │ │ │ ├── BinaryQueryFilterSerializer.cs │ │ │ │ │ └── QueryFilterSerializer.cs │ │ │ ├── Elasticsearch │ │ │ │ ├── Converter │ │ │ │ │ └── ElasticSearchVisitor.cs │ │ │ │ ├── ElasticSearchFormat.cs │ │ │ │ ├── Models │ │ │ │ │ ├── Bool.cs │ │ │ │ │ ├── BoolOperation.cs │ │ │ │ │ ├── Range.cs │ │ │ │ │ ├── Term.cs │ │ │ │ │ └── Terms.cs │ │ │ │ ├── Optimizers │ │ │ │ │ ├── BoolOptimizer.cs │ │ │ │ │ └── RangeOptimizer.cs │ │ │ │ └── Serializers │ │ │ │ │ ├── BoolOperationSerializer.cs │ │ │ │ │ ├── BoolSerializer.cs │ │ │ │ │ ├── RangeSerializer.cs │ │ │ │ │ ├── TermSerializer.cs │ │ │ │ │ └── TermsSerializer.cs │ │ │ └── Sql │ │ │ │ └── SqlFormat.cs │ │ ├── Koralium.Transport.RowLevelSecurity.csproj │ │ ├── Protos │ │ │ └── RowLevelSecurityService.proto │ │ ├── README.md │ │ └── Services │ │ │ └── RowLevelSecurityService.cs │ ├── Koralium.Transport │ │ ├── Column.cs │ │ ├── ColumnType.cs │ │ ├── Exceptions │ │ │ └── AuthorizationFailedException.cs │ │ ├── Extensions │ │ │ └── TransportTableExtensions.cs │ │ ├── IKoraliumTransportService.cs │ │ ├── Koralium.Transport.csproj │ │ ├── QueryResult.cs │ │ ├── Table.cs │ │ ├── TransportPartition.cs │ │ ├── TransportPartitionsResult.cs │ │ └── TransportServiceLocation.cs │ └── Koralium │ │ └── Koralium.csproj └── tests │ ├── Data.Koralium.Tests │ ├── ClientTests.cs │ ├── Data.Koralium.Tests.csproj │ ├── TestWebFactory.cs │ ├── TypeTests.cs │ └── testappsettings.json │ ├── EntityFrameworkCore.Koralium.Benchmarks │ ├── Db │ │ └── TestDbContext.cs │ ├── EntityFrameworkCore.Koralium.Benchmarks.csproj │ ├── Program.cs │ ├── SelectAllBenchmark.cs │ ├── TestWebFactory.cs │ └── testappsettings.json │ ├── EntityFrameworkCore.Koralium.Tests │ ├── Db │ │ └── TestDbContext.cs │ ├── EntityFrameworkCore.Koralium.Tests.csproj │ ├── TestWebFactory.cs │ ├── UnitTest1.cs │ └── testappsettings.json │ ├── Koralium.Benchmarks │ ├── IndexBenchmarks.cs │ ├── Koralium.Benchmarks.csproj │ ├── Program.cs │ ├── TestWebFactory.cs │ └── testappsettings.json │ ├── Koralium.Core.Tests │ ├── CheckAuthorizationTests.cs │ ├── CircularDependencyTests.cs │ └── Koralium.Core.Tests.csproj │ ├── Koralium.SqlParser.ANTLR.Benchmarks │ ├── Koralium.SqlParser.ANTLR.Benchmarks.csproj │ └── Program.cs │ ├── Koralium.SqlParser.ANTLR.Tests │ ├── Koralium.SqlParser.ANTLR.Tests.csproj │ └── SmokeTests.cs │ ├── Koralium.SqlParser.SmokeTests │ ├── BetweenTests.cs │ ├── BinaryTests.cs │ ├── BooleanBinaryTests.cs │ ├── BooleanComparisonTests.cs │ ├── BooleanExpressionOutputTests.cs │ ├── CastTests.cs │ ├── FromSubqueryTests.cs │ ├── FromTableNameTests.cs │ ├── FunctionTests.cs │ ├── GroupByTests.cs │ ├── HavingTests.cs │ ├── InExpressionTests.cs │ ├── IsNullTests.cs │ ├── Koralium.SqlParser.SmokeTests.csproj │ ├── LikeTests.cs │ ├── LiteralTests.cs │ ├── NotTests.cs │ ├── OffsetLimitTests.cs │ ├── OrderByTests.cs │ ├── PredicateTests.cs │ ├── SearchTests.cs │ ├── SelectColumnTests.cs │ ├── SmokeTestsBase.cs │ └── VariableTests.cs │ ├── Koralium.SqlParser.Tests │ ├── ClausesAcceptTests.cs │ ├── ClausesCloneTests.cs │ ├── ClausesEqualsTests.cs │ ├── CloneTests.cs │ ├── ExpressionEqualsTests.cs │ ├── ExpressionsAcceptTests.cs │ ├── FromAcceptTests.cs │ ├── FromCloneTests.cs │ ├── FromEqualsTests.cs │ ├── GroupByAcceptTests.cs │ ├── GroupByCloneTests.cs │ ├── GroupByEqualsTests.cs │ ├── Koralium.SqlParser.Tests.csproj │ ├── KoraliumSqlVisitorTests.cs │ ├── LiteralAcceptTests.cs │ ├── LiteralEqualsTests.cs │ ├── LiteralGetValueTests.cs │ ├── OrderByAcceptTests.cs │ ├── OrderByCloneTests.cs │ ├── OrderByEqualsTests.cs │ ├── PrintTests.cs │ ├── QueryBuilderTests.cs │ ├── StatementsAcceptTests.cs │ ├── StatementsCloneTests.cs │ ├── StatementsEqualsTests.cs │ └── TestClass.cs │ ├── Koralium.SqlToExpression.Benchmark │ ├── Koralium.SqlToExpression.Benchmark.csproj │ ├── Program.cs │ ├── Project.cs │ ├── TableResolver.cs │ └── Visitor.cs │ ├── Koralium.SqlToExpression.Tests │ ├── ColumnSelectTests.cs │ ├── Data │ │ ├── customer.csv │ │ ├── lineitem.csv │ │ ├── nation.csv │ │ ├── orders.csv │ │ ├── part.csv │ │ ├── partsupp.csv │ │ ├── region.csv │ │ └── supplier.csv │ ├── FunctionTests.cs │ ├── GetSchemaTests.cs │ ├── Helpers │ │ ├── GetColumnsComparer.cs │ │ ├── QueryComparer.cs │ │ ├── TableResolver.cs │ │ ├── TestData.cs │ │ ├── TpchData.cs │ │ ├── TpchTestsBase.cs │ │ └── TypeTestBase.cs │ ├── IndexHelperTests.cs │ ├── IndexVisitorTests.cs │ ├── InlineParameterTests.cs │ ├── Koralium.SqlToExpression.Tests.csproj │ ├── Models │ │ ├── ColumnTest.cs │ │ ├── EnumTest.cs │ │ ├── NullTest.cs │ │ ├── ObjectTest.cs │ │ └── tpch │ │ │ ├── Customer.cs │ │ │ ├── LineItem.cs │ │ │ ├── Nation.cs │ │ │ ├── Order.cs │ │ │ ├── Part.cs │ │ │ ├── Partsupp.cs │ │ │ ├── Region.cs │ │ │ └── Supplier.cs │ ├── NullableUtilsTests.cs │ ├── QueryTests.cs │ └── TypeTests.cs │ ├── Koralium.TestFramework.Tests │ ├── CustomTests.cs │ ├── Koralium.TestFramework.Tests.csproj │ ├── OrderTests.cs │ ├── TestWebFactory.cs │ ├── TypeTests.cs │ ├── UnitTest1.cs │ └── testappsettings.json │ ├── Koralium.Transport.ArrowFlight.Tests │ ├── ArrayTypeComparer.cs │ ├── FieldComparer.cs │ ├── FlightInfoComparer.cs │ ├── FlightTests.cs │ ├── Koralium.Transport.ArrowFlight.Tests.csproj │ ├── SchemaComparer.cs │ ├── TestWebFactory.cs │ └── testappsettings.json │ ├── Koralium.Transport.Benchmarks │ ├── Koralium.Transport.Benchmarks.csproj │ ├── Program.cs │ ├── TestWebFactory.cs │ ├── TransportBenchmarks.cs │ └── testappsettings.json │ ├── Koralium.Transport.Json.Tests │ ├── JsonTests.cs │ ├── Koralium.Transport.Json.Tests.csproj │ ├── TestWebFactory.cs │ └── testappsettings.json │ ├── Koralium.Transport.RowLevelSecurity.Tests │ ├── Koralium.Transport.RowLevelSecurity.Tests.csproj │ ├── RowLevelSecurityTests.cs │ ├── TestWebFactory.cs │ └── testappsettings.json │ └── Koralium.WebTests │ ├── Controllers │ └── OrdersController.cs │ ├── CustomSearchProvider.cs │ ├── Database │ └── TestContext.cs │ ├── Dockerfile │ ├── Entities │ ├── Company.cs │ ├── Employee.cs │ ├── Empty.cs │ ├── IndexTest.cs │ ├── NoNamingPolicyTest.cs │ ├── OtherObject.cs │ ├── Project.cs │ ├── Secure.cs │ ├── SpecialCharactersTest.cs │ ├── Test.cs │ ├── TestObject.cs │ ├── TestTypeEnum.cs │ ├── TypeTest.cs │ ├── TypeTestInnerInnerObject.cs │ ├── TypeTestInnerObject.cs │ ├── specific │ │ └── AutoMapperCustomer.cs │ └── tpch │ │ ├── Customer.cs │ │ ├── LineItem.cs │ │ ├── Nation.cs │ │ ├── Order.cs │ │ ├── Part.cs │ │ ├── Partsupp.cs │ │ ├── Region.cs │ │ └── Supplier.cs │ ├── Koralium.WebTests.csproj │ ├── PartitionResolvers │ └── OrdersPartitionResolver.cs │ ├── Program.cs │ ├── Properties │ └── launchSettings.json │ ├── Resolvers │ ├── CompanyResolver.cs │ ├── CustomerIndexResolver.cs │ ├── EmployeeResolver.cs │ ├── EmptyResolver.cs │ ├── IndexTestResolver.cs │ ├── NoNamingPolicyResolver.cs │ ├── ProjectResolver.cs │ ├── SecureResolver.cs │ ├── SpecialCharacterResolver.cs │ ├── TestResolver.cs │ ├── TypeTestResolver.cs │ ├── specific │ │ └── AutoMapperCustomerResolver.cs │ └── tpch │ │ ├── CustomerResolver.cs │ │ ├── EfCustomerResolver.cs │ │ ├── NationResolver.cs │ │ ├── OrderResolver.cs │ │ ├── PartResolver.cs │ │ ├── PartsuppResolver.cs │ │ ├── RegionResolver.cs │ │ ├── SupplierResolver.cs │ │ └── lineItemResolver.cs │ ├── Startup.cs │ ├── TestData.cs │ ├── TpchData.cs │ ├── appsettings.Development.json │ └── appsettings.json ├── presto ├── presto-connector-arrowflight │ ├── .gitattributes │ ├── .gitignore │ ├── README.md │ ├── convert.ps1 │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── io │ │ │ │ └── prestosql │ │ │ │ └── plugin │ │ │ │ └── koralium │ │ │ │ ├── KoraliumConfig.java │ │ │ │ ├── KoraliumConnector.java │ │ │ │ ├── KoraliumConnectorFactory.java │ │ │ │ ├── KoraliumConnectorModule.java │ │ │ │ ├── KoraliumHandleResolver.java │ │ │ │ ├── KoraliumIndexHandle.java │ │ │ │ ├── KoraliumMetadata.java │ │ │ │ ├── KoraliumPageSource.java │ │ │ │ ├── KoraliumPageSourceCache.java │ │ │ │ ├── KoraliumPageSourceProvider.java │ │ │ │ ├── KoraliumPlugin.java │ │ │ │ ├── KoraliumPrestoColumn.java │ │ │ │ ├── KoraliumPrestoTable.java │ │ │ │ ├── KoraliumSortItem.java │ │ │ │ ├── KoraliumSplit.java │ │ │ │ ├── KoraliumSplitManager.java │ │ │ │ ├── KoraliumTableHandle.java │ │ │ │ ├── KoraliumTableIndex.java │ │ │ │ ├── KoraliumTransactionHandle.java │ │ │ │ ├── KoraliumType.java │ │ │ │ ├── cache │ │ │ │ ├── DisabledCacheSplitManager.java │ │ │ │ ├── DisabledQueryCache.java │ │ │ │ ├── DisabledQueryCacheEntry.java │ │ │ │ ├── QueryCache.java │ │ │ │ ├── QueryCacheEntry.java │ │ │ │ ├── QueryCacheFactory.java │ │ │ │ ├── QueryCacheSplitManager.java │ │ │ │ ├── RedisCoordinatorCacheEntry.java │ │ │ │ ├── RedisCoordinatorCacheSplitManager.java │ │ │ │ └── RedisCoordinatorQueryCache.java │ │ │ │ ├── client │ │ │ │ ├── FilterExtractor.java │ │ │ │ ├── FlightHeaderFactory.java │ │ │ │ ├── KoraliumClient.java │ │ │ │ ├── KoraliumMetadataClient.java │ │ │ │ ├── KoraliumPrestoMetadataCache.java │ │ │ │ ├── PrestoKoraliumMetadataClient.java │ │ │ │ └── QueryBuilder.java │ │ │ │ ├── decoders │ │ │ │ ├── BinaryDecoder.java │ │ │ │ ├── BoolDecoder.java │ │ │ │ ├── DoubleDecoder.java │ │ │ │ ├── FloatDecoder.java │ │ │ │ ├── Int16Decoder.java │ │ │ │ ├── Int32Decoder.java │ │ │ │ ├── Int64Decoder.java │ │ │ │ ├── KoraliumDecoder.java │ │ │ │ ├── ListDecoder.java │ │ │ │ ├── ObjectTypeDecoder.java │ │ │ │ ├── PrimitiveDecoder.java │ │ │ │ ├── StringDecoder.java │ │ │ │ ├── TimestampDecoder.java │ │ │ │ ├── UInt32Decoder.java │ │ │ │ ├── UInt64Decoder.java │ │ │ │ └── UInt8Decoder.java │ │ │ │ └── utils │ │ │ │ ├── ArrowPrestoTypeConverter.java │ │ │ │ ├── PrestoArrowTypeVisitor.java │ │ │ │ ├── SchemaToDecoders.java │ │ │ │ ├── SqlFromTableVisitor.java │ │ │ │ ├── SqlUtils.java │ │ │ │ └── TypeConvertResult.java │ │ └── proto │ │ │ └── presto.proto │ │ ├── modernizer │ │ └── violations.xml │ │ └── test │ │ ├── java │ │ └── io │ │ │ └── prestosql │ │ │ └── plugin │ │ │ └── koralium │ │ │ ├── CsvOutput.java │ │ │ ├── DataLoader.java │ │ │ ├── KoraliumQueryRunner.java │ │ │ ├── QueryServer.java │ │ │ ├── RedisServer.java │ │ │ ├── TestCache.java │ │ │ ├── TestKoraliumAggregations.java │ │ │ ├── TestKoraliumJoinQueries.java │ │ │ ├── TestKoraliumSmokeTest.java │ │ │ └── TestingKoraliumConnectorFactory.java │ │ └── resources │ │ └── example-data │ │ ├── example-metadata.json │ │ ├── lineitem-1.csv │ │ ├── lineitem-2.csv │ │ ├── numbers-1.csv │ │ ├── numbers-2.csv │ │ ├── orders-1.csv │ │ └── orders-2.csv ├── presto-connector-legacy │ ├── .gitattributes │ ├── .gitignore │ ├── README.md │ ├── convert.ps1 │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── io │ │ │ │ └── prestosql │ │ │ │ └── plugin │ │ │ │ └── koralium │ │ │ │ ├── KoraliumBasePageSource.java │ │ │ │ ├── KoraliumColumnHandle.java │ │ │ │ ├── KoraliumConfig.java │ │ │ │ ├── KoraliumConnector.java │ │ │ │ ├── KoraliumConnectorFactory.java │ │ │ │ ├── KoraliumConnectorIndex.java │ │ │ │ ├── KoraliumConnectorModule.java │ │ │ │ ├── KoraliumExecutionColumn.java │ │ │ │ ├── KoraliumHandleResolver.java │ │ │ │ ├── KoraliumIndexHandle.java │ │ │ │ ├── KoraliumIndexPageSource.java │ │ │ │ ├── KoraliumIndexProvider.java │ │ │ │ ├── KoraliumMetadata.java │ │ │ │ ├── KoraliumPageSource.java │ │ │ │ ├── KoraliumPageSourceProvider.java │ │ │ │ ├── KoraliumPlugin.java │ │ │ │ ├── KoraliumSortItem.java │ │ │ │ ├── KoraliumSplit.java │ │ │ │ ├── KoraliumSplitManager.java │ │ │ │ ├── KoraliumTable.java │ │ │ │ ├── KoraliumTableHandle.java │ │ │ │ ├── KoraliumTableIndex.java │ │ │ │ ├── KoraliumTransactionHandle.java │ │ │ │ ├── KoraliumType.java │ │ │ │ ├── client │ │ │ │ ├── FilterExtractor.java │ │ │ │ ├── KoraliumMetadataCache.java │ │ │ │ ├── KoraliumMetadataClient.java │ │ │ │ ├── PrestoKoraliumClient.java │ │ │ │ └── QueryBuilder.java │ │ │ │ ├── decoders │ │ │ │ ├── ArrayDecoder.java │ │ │ │ ├── BoolDecoder.java │ │ │ │ ├── DoubleDecoder.java │ │ │ │ ├── FloatDecoder.java │ │ │ │ ├── Int64Decoder.java │ │ │ │ ├── IntDecoder.java │ │ │ │ ├── KoraliumDecoder.java │ │ │ │ ├── ObjectTypeDecoder.java │ │ │ │ ├── StringDecoder.java │ │ │ │ └── TimestampDecoder.java │ │ │ │ ├── encoders │ │ │ │ ├── BoolEncoder.java │ │ │ │ ├── DoubleEncoder.java │ │ │ │ ├── FloatEncoder.java │ │ │ │ ├── IEncoder.java │ │ │ │ ├── Int64Encoder.java │ │ │ │ ├── IntEncoder.java │ │ │ │ ├── StringEncoder.java │ │ │ │ └── TimestampEncoder.java │ │ │ │ └── utils │ │ │ │ └── GrpcColumnReverter.java │ │ └── proto │ │ │ └── presto.proto │ │ ├── modernizer │ │ └── violations.xml │ │ └── test │ │ ├── java │ │ └── io │ │ │ └── prestosql │ │ │ └── plugin │ │ │ └── koralium │ │ │ ├── CsvOutput.java │ │ │ ├── DataLoader.java │ │ │ ├── KoraliumQueryRunner.java │ │ │ ├── QueryServer.java │ │ │ ├── TestKoraliumAggregations.java │ │ │ ├── TestKoraliumJoinQueries.java │ │ │ ├── TestKoraliumSmokeTest.java │ │ │ └── TestingKoraliumConnectorFactory.java │ │ └── resources │ │ └── example-data │ │ ├── example-metadata.json │ │ ├── lineitem-1.csv │ │ ├── lineitem-2.csv │ │ ├── numbers-1.csv │ │ ├── numbers-2.csv │ │ ├── orders-1.csv │ │ └── orders-2.csv └── trino-connector-arrowflight │ ├── .gitattributes │ ├── .gitignore │ ├── .mvn │ └── modernizer │ │ └── violations.xml │ ├── README.md │ ├── convert.ps1 │ ├── pom.xml │ └── src │ ├── main │ ├── java │ │ └── io │ │ │ └── trino │ │ │ └── plugin │ │ │ └── koralium │ │ │ ├── KoraliumConfig.java │ │ │ ├── KoraliumConnector.java │ │ │ ├── KoraliumConnectorFactory.java │ │ │ ├── KoraliumConnectorModule.java │ │ │ ├── KoraliumHandleResolver.java │ │ │ ├── KoraliumIndexHandle.java │ │ │ ├── KoraliumMetadata.java │ │ │ ├── KoraliumPageSource.java │ │ │ ├── KoraliumPageSourceCache.java │ │ │ ├── KoraliumPageSourceProvider.java │ │ │ ├── KoraliumPlugin.java │ │ │ ├── KoraliumPrestoColumn.java │ │ │ ├── KoraliumPrestoTable.java │ │ │ ├── KoraliumSortItem.java │ │ │ ├── KoraliumSplit.java │ │ │ ├── KoraliumSplitManager.java │ │ │ ├── KoraliumTableHandle.java │ │ │ ├── KoraliumTableIndex.java │ │ │ ├── KoraliumTransactionHandle.java │ │ │ ├── KoraliumType.java │ │ │ ├── cache │ │ │ ├── DisabledCacheSplitManager.java │ │ │ ├── DisabledQueryCache.java │ │ │ ├── DisabledQueryCacheEntry.java │ │ │ ├── QueryCache.java │ │ │ ├── QueryCacheEntry.java │ │ │ ├── QueryCacheFactory.java │ │ │ ├── QueryCacheSplitManager.java │ │ │ ├── RedisCoordinatorCacheEntry.java │ │ │ ├── RedisCoordinatorCacheSplitManager.java │ │ │ └── RedisCoordinatorQueryCache.java │ │ │ ├── client │ │ │ ├── FilterExtractor.java │ │ │ ├── FlightHeaderFactory.java │ │ │ ├── KoraliumClient.java │ │ │ ├── KoraliumMetadataClient.java │ │ │ ├── KoraliumPrestoMetadataCache.java │ │ │ ├── PrestoKoraliumMetadataClient.java │ │ │ └── QueryBuilder.java │ │ │ ├── decoders │ │ │ ├── BinaryDecoder.java │ │ │ ├── BoolDecoder.java │ │ │ ├── Decimal128Decoder.java │ │ │ ├── DoubleDecoder.java │ │ │ ├── FloatDecoder.java │ │ │ ├── Int16Decoder.java │ │ │ ├── Int32Decoder.java │ │ │ ├── Int64Decoder.java │ │ │ ├── KoraliumDecoder.java │ │ │ ├── ListDecoder.java │ │ │ ├── ObjectTypeDecoder.java │ │ │ ├── PrimitiveDecoder.java │ │ │ ├── StringDecoder.java │ │ │ ├── TimestampDecoder.java │ │ │ ├── UInt32Decoder.java │ │ │ ├── UInt64Decoder.java │ │ │ └── UInt8Decoder.java │ │ │ └── utils │ │ │ ├── ArrowPrestoTypeConverter.java │ │ │ ├── PrestoArrowTypeVisitor.java │ │ │ ├── SchemaToDecoders.java │ │ │ ├── SqlFromTableVisitor.java │ │ │ ├── SqlUtils.java │ │ │ └── TypeConvertResult.java │ └── proto │ │ └── presto.proto │ ├── modernizer │ └── violations.xml │ └── test │ ├── java │ └── io │ │ └── trino │ │ └── plugin │ │ └── koralium │ │ ├── CsvOutput.java │ │ ├── DataLoader.java │ │ ├── KoraliumQueryRunner.java │ │ ├── QueryServer.java │ │ ├── RedisServer.java │ │ ├── TestCache.java │ │ ├── TestKoraliumAggregations.java │ │ ├── TestKoraliumConnectorSmokeTest.java │ │ ├── TestKoraliumJoinQueries.java │ │ └── TestingKoraliumConnectorFactory.java │ └── resources │ └── example-data │ ├── example-metadata.json │ ├── lineitem-1.csv │ ├── lineitem-2.csv │ ├── numbers-1.csv │ ├── numbers-2.csv │ ├── orders-1.csv │ └── orders-2.csv ├── pretest.ps1 └── typescript-client ├── arrow ├── generate_proto_files.ps1 ├── jest.config.js ├── package-lock.json ├── package.json ├── src │ ├── generated │ │ ├── Flight_grpc_pb.d.ts │ │ ├── Flight_grpc_pb.js │ │ ├── Flight_pb.d.ts │ │ └── Flight_pb.js │ ├── index.ts │ ├── internal │ │ ├── KoraliumList.ts │ │ ├── KoraliumRow.ts │ │ ├── arrow │ │ │ ├── bit.ts │ │ │ ├── buffer.ts │ │ │ ├── compat.ts │ │ │ ├── int.ts │ │ │ ├── io │ │ │ │ ├── adapters.ts │ │ │ │ └── interfaces.ts │ │ │ ├── loader.ts │ │ │ ├── type.ts │ │ │ ├── utf8.ts │ │ │ └── utils │ │ │ │ └── MessageReader.ts │ │ └── typevisitor.ts │ ├── koraliumarrowclient.ts │ ├── result.ts │ └── streamreader.ts ├── test-report.xml ├── tests │ ├── apolloserverintegration.test.ts │ ├── arrowclient.test.ts │ ├── queryserver.ts │ └── tpchdata.ts └── tsconfig.json ├── base-client ├── jest.config.js ├── package-lock.json ├── package.json ├── src │ ├── filterBuilder.ts │ ├── index.ts │ ├── koraliumClient.ts │ ├── objectToSelectMapper.ts │ ├── parameterBuilder.ts │ ├── queryBuilder.ts │ ├── queryOptions.ts │ └── queryResult.ts ├── test-report.xml ├── tests │ └── queryBuilder.test.ts └── tsconfig.json ├── json ├── jest.config.js ├── package-lock.json ├── package.json ├── src │ ├── client.ts │ └── index.ts ├── test-report.xml ├── tests │ ├── apolloserverintegration.test.ts │ ├── client.test.ts │ ├── queryserver.ts │ └── tpchdata.ts └── tsconfig.json ├── legacy ├── generate_proto_files.ps1 ├── jest.config.js ├── package-lock.json ├── package.json ├── protos │ ├── google │ │ └── protobuf │ │ │ ├── any.proto │ │ │ ├── api.proto │ │ │ ├── compiler │ │ │ └── plugin.proto │ │ │ ├── descriptor.proto │ │ │ ├── duration.proto │ │ │ ├── empty.proto │ │ │ ├── field_mask.proto │ │ │ ├── source_context.proto │ │ │ ├── struct.proto │ │ │ ├── timestamp.proto │ │ │ ├── type.proto │ │ │ └── wrappers.proto │ └── koralium.proto ├── src │ ├── client.ts │ ├── decoders │ │ ├── IntDecoder.ts │ │ ├── ScalarDecoder.ts │ │ ├── arrayDecoder.ts │ │ ├── baseDecoder.ts │ │ ├── boolDecoder.ts │ │ ├── decoder.ts │ │ ├── decoders.ts │ │ ├── doubleDecoder.ts │ │ ├── floatDecoder.ts │ │ ├── longDecoder.ts │ │ ├── objectDecoder.ts │ │ ├── stringDecoder.ts │ │ └── timestampDecoder.ts │ ├── encoders │ │ ├── parameterEncoder.ts │ │ └── scalarEncoder.ts │ ├── filterBuilder.ts │ ├── generated │ │ ├── koralium_grpc_pb.d.ts │ │ ├── koralium_grpc_pb.js │ │ ├── koralium_pb.d.ts │ │ └── koralium_pb.js │ ├── index.ts │ ├── objectToSelectMapper.ts │ ├── parameterBuilder.ts │ ├── queryBuilder.ts │ ├── queryOptions.ts │ └── queryResult.ts ├── test-report.xml ├── tests │ ├── client.test.ts │ ├── queryBuilder.test.ts │ ├── queryserver.ts │ └── tpchdata.ts └── tsconfig.json ├── lerna.json ├── package.json └── rowlevelsecurity ├── generate_proto_files.ps1 ├── jest.config.js ├── package-lock.json ├── package.json ├── protos └── rowlevelsecurity.proto ├── src ├── cubejsModels.ts ├── generated │ ├── rowlevelsecurity_grpc_pb.d.ts │ ├── rowlevelsecurity_grpc_pb.js │ ├── rowlevelsecurity_pb.d.ts │ └── rowlevelsecurity_pb.js ├── index.ts ├── koraliumCubeJsQueryTransformer.ts └── rowLevelSecurityClient.ts ├── test-report.xml ├── tests ├── client.test.ts ├── koraliumCubeJsQueryTransformer.test.ts └── queryserver.ts └── tsconfig.json /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # To get started with Dependabot version updates, you'll need to specify which 2 | # package ecosystems to update and where the package manifests are located. 3 | # Please see the documentation for all configuration options: 4 | # https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates 5 | 6 | version: 2 7 | updates: 8 | - package-ecosystem: "nuget" # See documentation for possible values 9 | directory: "/netcore" # Location of package manifests 10 | schedule: 11 | interval: "daily" 12 | - package-ecosystem: "maven" # See documentation for possible values 13 | directory: "/" # Location of package manifests 14 | schedule: 15 | interval: "daily" 16 | -------------------------------------------------------------------------------- /TestData/tpch/region.csv: -------------------------------------------------------------------------------- 1 | regionkey,name,comment 2 | 0,AFRICA,lar deposits. blithely final packages cajole. regular waters are final requests. regular accounts are according to 3 | 1,AMERICA,"hs use ironic, even requests. s" 4 | 2,ASIA,ges. thinly even pinto beans ca 5 | 3,EUROPE,ly final courts cajole furiously final excuse 6 | 4,MIDDLE EAST,uickly special accounts cajole carefully blithely close requests. carefully final asymptotes haggle furiousl 7 | -------------------------------------------------------------------------------- /docs/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "restructuredtext.confPath": "${workspaceFolder}\\source" 3 | } -------------------------------------------------------------------------------- /docs/Makefile: -------------------------------------------------------------------------------- 1 | # Minimal makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line, and also 5 | # from the environment for the first two. 6 | SPHINXOPTS ?= 7 | SPHINXBUILD ?= sphinx-build 8 | SOURCEDIR = source 9 | BUILDDIR = build 10 | 11 | # Put it first so that "make" without argument is like "make help". 12 | help: 13 | @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 14 | 15 | .PHONY: help Makefile 16 | 17 | # Catch-all target: route all unknown targets to Sphinx using the new 18 | # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). 19 | %: Makefile 20 | @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 21 | -------------------------------------------------------------------------------- /docs/make.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | pushd %~dp0 4 | 5 | REM Command file for Sphinx documentation 6 | 7 | if "%SPHINXBUILD%" == "" ( 8 | set SPHINXBUILD=sphinx-build 9 | ) 10 | set SOURCEDIR=source 11 | set BUILDDIR=build 12 | 13 | if "%1" == "" goto help 14 | 15 | %SPHINXBUILD% >NUL 2>NUL 16 | if errorlevel 9009 ( 17 | echo. 18 | echo.The 'sphinx-build' command was not found. Make sure you have Sphinx 19 | echo.installed, then set the SPHINXBUILD environment variable to point 20 | echo.to the full path of the 'sphinx-build' executable. Alternatively you 21 | echo.may add the Sphinx directory to PATH. 22 | echo. 23 | echo.If you don't have Sphinx installed, grab it from 24 | echo.http://sphinx-doc.org/ 25 | exit /b 1 26 | ) 27 | 28 | %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% 29 | goto end 30 | 31 | :help 32 | %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% 33 | 34 | :end 35 | popd 36 | -------------------------------------------------------------------------------- /docs/source/configuration.rst: -------------------------------------------------------------------------------- 1 | Configuration 2 | =============== 3 | 4 | This section is a work in progress. 5 | 6 | Custom column name 7 | ------------------- 8 | 9 | It is possible to override the column name that is given to a property. 10 | That is done by using the attribute *ColumnName*, example: 11 | 12 | .. code-block:: csharp 13 | 14 | [ColumnName("test"] 15 | public string OtherName { get; set; } 16 | 17 | OtherName will now be called "test". 18 | 19 | It is also possible to set a default naming policy during configuration: 20 | 21 | .. code-block:: csharp 22 | 23 | public void ConfigureServices(IServiceCollection services) 24 | { 25 | ... 26 | services.AddKoralium(opt => 27 | { 28 | ... 29 | opt.AddTableResolver(opt => 30 | { 31 | opt.TableName = "test"; 32 | opt.PropertyNamingPolicy = JsonNamingPolicy.CamelCase; 33 | }); 34 | ... 35 | }); 36 | ... 37 | } 38 | 39 | The default naming policy is camelCase. 40 | 41 | To remove the naming policy simple set *PropertyNamingPolicy = null*. -------------------------------------------------------------------------------- /docs/source/contributor/addingtype.rst: -------------------------------------------------------------------------------- 1 | Adding new type support 2 | ======================== 3 | 4 | This section describes the steps that are required to add support for a new data type. 5 | 6 | 7 | Koralium.Transport: 8 | 9 | * ColumnType - Add type to enum 10 | 11 | Koralium.Core: 12 | 13 | * ColumnTypeHelper - Convert type to the enum, add nullable support. 14 | 15 | Arrow Flight: 16 | 17 | * Add type support in TypeConverter. 18 | * Add encoder class 19 | * EncoderHelper - Resolve encoder. 20 | 21 | Json: 22 | 23 | * Add new encoder class 24 | * Resolve encoder in EncoderHelper 25 | 26 | Presto: 27 | 28 | * Add decoder class 29 | * Add type to KoraliumType enum 30 | * Resolve type in PrestoArrowTypeVisitor, 31 | 32 | ADO.NET: 33 | 34 | * Add decoder class 35 | * Resolve in TypeDecoderVisitor -------------------------------------------------------------------------------- /docs/source/contributordocs.rst: -------------------------------------------------------------------------------- 1 | Contributor Documentation 2 | ========================== 3 | 4 | This documentation regards internal documentation when contributing to Koralium. 5 | 6 | .. toctree:: 7 | :maxdepth: 2 8 | :caption: Contents: 9 | 10 | contributor/addingtype -------------------------------------------------------------------------------- /docs/source/datatypes.rst: -------------------------------------------------------------------------------- 1 | Data Types 2 | =========== 3 | 4 | The supported data types are: 5 | 6 | * Boolean 7 | * DateTime 8 | * Double 9 | * Float 10 | * Short (int16) 11 | * Int (int32) 12 | * Long (int64) 13 | * String 14 | * Byte (uint8) 15 | * UInt (uint32) 16 | * ULong (uint64) 17 | * Lists 18 | * Objects 19 | * Byte[] (binary) 20 | * Enums 21 | * Decimal 22 | 23 | Enums 24 | ------ 25 | 26 | All enums are represented as strings both in Json and Apache Arrow Flight. 27 | This is done to create a better readability of the value of the enum. 28 | 29 | This means that enums are filtered the same way as strings, example: 30 | 31 | ``` 32 | SELECT enumValue FROM test WHERE enumValue = 'Active' 33 | ``` 34 | 35 | This would only select rows that has 'enumValue' set as 'Active'. 36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/source/entityframeworkclient.rst: -------------------------------------------------------------------------------- 1 | Entity Framework Core Client 2 | ============================= 3 | 4 | This section covers how to connect to a *Koralium SQL API* using Entity Framework Core. 5 | 6 | Setup 7 | ------ 8 | 9 | Install the following nuget package: 10 | 11 | * EntityFrameworkCore.Koralium 12 | 13 | Create a DbContext: 14 | 15 | .. code-block:: csharp 16 | 17 | public class UserDbContext : DbContext 18 | { 19 | public TestDbContext(DbContextOptions options) : base(options) 20 | { 21 | } 22 | 23 | public DbSet Users { get; set; } 24 | 25 | protected override void OnModelCreating(ModelBuilder modelBuilder) 26 | { 27 | modelBuilder.Entity(opt => 28 | { 29 | opt.ToTable("user") //Table name should be equal to the table name set in the API 30 | .HasKey(x => x.Id); 31 | }); 32 | } 33 | } 34 | 35 | Add the DbContext to services: 36 | 37 | .. code-block:: csharp 38 | 39 | services.AddDbContext(opt => 40 | { 41 | opt.UseKoralium($"DataSource=http://localhost:5000"); 42 | }); 43 | 44 | -------------------------------------------------------------------------------- /docs/source/index.rst: -------------------------------------------------------------------------------- 1 | .. Koralium documentation master file, created by 2 | sphinx-quickstart on Sun Oct 25 21:13:15 2020. 3 | You can adapt this file completely to your liking, but it should at least 4 | contain the root `toctree` directive. 5 | 6 | Koralium SQL API 7 | ==================================== 8 | 9 | .. toctree:: 10 | :maxdepth: 2 11 | :caption: Contents: 12 | 13 | gettingstarted 14 | configuration 15 | authorization 16 | entityframeworkclient 17 | joins 18 | searchfunctionality 19 | parameters 20 | datatypes 21 | indexsupport 22 | trinoconnector 23 | inmemorydata 24 | contributordocs 25 | sql 26 | 27 | -------------------------------------------------------------------------------- /docs/source/inmemorydata.rst: -------------------------------------------------------------------------------- 1 | In Memory Data 2 | =============== 3 | 4 | In some cases the data might not come from a database with entity framework core, or elasticsearch, etc. 5 | When the data is in memory, some operations might not work as expected as when the data comes from a database, such as: 6 | 7 | * String comparisons is case insensitive in a database but not in memory 8 | * Selecting object sub fields will throw null exceptions. 9 | 10 | To fix this it is possible to mark a table as being in memory: 11 | 12 | .. code-block:: csharp 13 | 14 | opt.AddTableResolver(o => 15 | { 16 | //Mark that this table uses data stored in memory 17 | o.UseInMemoryOperations(); 18 | }); 19 | 20 | 21 | This will then add a new operations provider that is suitable to handle in memory operations to still have case insensitive string comparisons and not throwing null exceptions. 22 | -------------------------------------------------------------------------------- /docs/source/joins.rst: -------------------------------------------------------------------------------- 1 | Joins 2 | ====== 3 | 4 | Join operations are not supported in *Koralium SQL API*. 5 | 6 | This choice was taken early in development since supporting joins can hinder future features, such as distrubuted partitions etc. 7 | If you want to join data between data sources, it is instead recommended to use a federated query engine such as *PrestoSQL*. 8 | 9 | *Koralium* supports returning arrays and objects in the result for each entry, so the data should instead be presented in that manner. 10 | -------------------------------------------------------------------------------- /docs/source/searchfunctionality.rst: -------------------------------------------------------------------------------- 1 | Search functionality 2 | ===================== 3 | 4 | -------------------------------------------------------------------------------- /docs/source/sql.rst: -------------------------------------------------------------------------------- 1 | SQL 2 | === 3 | 4 | .. toctree:: 5 | :maxdepth: 2 6 | :caption: Contents: 7 | 8 | sql/functions -------------------------------------------------------------------------------- /docs/source/sql/functions.rst: -------------------------------------------------------------------------------- 1 | SQL Functions 2 | ============== 3 | 4 | 5 | Array functions 6 | ---------------- 7 | 8 | Any_match 9 | ********** 10 | 11 | *any_match* is a function that allows the caller to check if any element in an array fulfills a certain predicate. 12 | 13 | Example: 14 | 15 | .. code-block:: sql 16 | 17 | SELECT * FROM test WHERE any_match(arr, x -> x = 'test') 18 | 19 | Filter 20 | ******* 21 | 22 | *filter* is a function that takes in an array and returns all elements that fulfills a certain predicate. 23 | 24 | Example: 25 | 26 | .. code-block:: sql 27 | 28 | SELECT filter(arr, x -> x = 'test') FROM test 29 | 30 | First 31 | ****** 32 | 33 | *first* returns the first element in an array. 34 | 35 | Example: 36 | 37 | .. code-block:: sql 38 | 39 | SELECT first(arr) FROM test 40 | 41 | It is also possible to add a predicate as the second argument. 42 | 43 | .. code-block:: sql 44 | 45 | SELECT first(arr, x -> x = 'test') FROM test 46 | 47 | -------------------------------------------------------------------------------- /netcore/.dockerignore: -------------------------------------------------------------------------------- 1 | **/.classpath 2 | **/.dockerignore 3 | **/.env 4 | **/.git 5 | **/.gitignore 6 | **/.project 7 | **/.settings 8 | **/.toolstarget 9 | **/.vs 10 | **/.vscode 11 | **/*.*proj.user 12 | **/*.dbmdl 13 | **/*.jfm 14 | **/azds.yaml 15 | **/bin 16 | **/charts 17 | **/docker-compose* 18 | **/Dockerfile* 19 | **/node_modules 20 | **/npm-debug.log 21 | **/obj 22 | **/secrets.dev.yaml 23 | **/values.dev.yaml 24 | LICENSE 25 | README.md -------------------------------------------------------------------------------- /netcore/.netconfig: -------------------------------------------------------------------------------- 1 | [ReportGenerator] 2 | report = tests/Data.Koralium.Tests/TestResults/**/coverage.opencover.xml 3 | report = tests/EntityFrameworkCore.Koralium.Tests/TestResults/**/coverage.opencover.xml 4 | report = tests/Koralium.SqlToExpression.Tests/TestResults/**/coverage.opencover.xml 5 | report = tests/Koralium.TestFramework.Tests/TestResults/**/coverage.opencover.xml -------------------------------------------------------------------------------- /netcore/Koralium.sln.licenseheader: -------------------------------------------------------------------------------- 1 | extensions: designer.cs generated.cs 2 | extensions: .cs .cpp .h 3 | /* 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ -------------------------------------------------------------------------------- /netcore/coverlet.runsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | opencover 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /netcore/src/Koralium.Core/Interfaces/ICustomMetadata.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | namespace Koralium 15 | { 16 | public interface ICustomMetadata 17 | { 18 | void AddMetadata(string name, T value); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /netcore/src/Koralium.Core/Interfaces/IDiscoveryService.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | using Koralium.Models; 15 | using System.Collections.Immutable; 16 | 17 | namespace Koralium.Interfaces 18 | { 19 | public interface IDiscoveryService 20 | { 21 | /// 22 | /// Get the service locations that was discovered. 23 | /// 24 | /// A list of service locations 25 | IImmutableList GetServices(); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /netcore/src/Koralium.Core/Partitions/PartitionsBuilder.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | using Koralium.SqlParser.Statements; 15 | 16 | namespace Koralium 17 | { 18 | public class PartitionsBuilder 19 | { 20 | internal PartitionsBuilder(StatementList sqlTree) 21 | { 22 | SqlTree = sqlTree; 23 | } 24 | 25 | public StatementList SqlTree { get; } 26 | 27 | public PartitionBuilder NewPartition() 28 | { 29 | return new PartitionBuilder(SqlTree.Clone() as StatementList); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /netcore/src/Koralium.Core/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | using System.Runtime.CompilerServices; 15 | 16 | [assembly: InternalsVisibleTo("Koralium.Core.Tests")] -------------------------------------------------------------------------------- /netcore/src/Koralium.Core/README.md: -------------------------------------------------------------------------------- 1 | The core project contains -------------------------------------------------------------------------------- /netcore/src/Koralium.Core/Resolvers/DefaultPartitionResolver.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | 15 | namespace Koralium.Resolvers 16 | { 17 | internal class DefaultPartitionResolver : PartitionResolver 18 | { 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /netcore/src/Koralium.Core/Services/DefaultDiscoveryService.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | using Koralium.Interfaces; 15 | using Koralium.Models; 16 | using System.Collections.Immutable; 17 | 18 | namespace Koralium.Services 19 | { 20 | class DefaultDiscoveryService : IDiscoveryService 21 | { 22 | public DefaultDiscoveryService() 23 | { 24 | } 25 | 26 | public IImmutableList GetServices() 27 | { 28 | return ImmutableList.Create(); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /netcore/src/Koralium.Data.ArrowFlight/Utils/ListCreator.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | using System; 15 | 16 | namespace Koralium.Data.ArrowFlight.Utils 17 | { 18 | internal abstract class ListCreator 19 | { 20 | public abstract Type ElementType { get; } 21 | 22 | public abstract object Build(); 23 | 24 | public abstract void AddElement(object obj); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /netcore/src/Koralium.EntityFrameworkCore.ArrowFlight/Diagnostics/Internal/KoraliumLoggingDefinitions.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | using Microsoft.EntityFrameworkCore.Diagnostics; 15 | 16 | namespace Koralium.EntityFrameworkCore.ArrowFlight.Diagnostics.Internal 17 | { 18 | public class KoraliumLoggingDefinitions : RelationalLoggingDefinitions 19 | { 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /netcore/src/Koralium.EntityFrameworkCore.ArrowFlight/Koralium.EntityFrameworkCore.ArrowFlight.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.1 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /netcore/src/Koralium.EntityFrameworkCore.ArrowFlight/Storage/Internal/KoraliumSqlGenerationHelper.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | using Microsoft.EntityFrameworkCore.Storage; 15 | 16 | namespace Koralium.EntityFrameworkCore.ArrowFlight.Storage.Internal 17 | { 18 | public class KoraliumSqlGenerationHelper : RelationalSqlGenerationHelper 19 | { 20 | public KoraliumSqlGenerationHelper(RelationalSqlGenerationHelperDependencies dependencies) : base(dependencies) 21 | { 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /netcore/src/Koralium.Shared/Attributes/ColumnNameAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace Koralium 6 | { 7 | [AttributeUsage(AttributeTargets.Property)] 8 | public class ColumnNameAttribute : Attribute 9 | { 10 | public string Name { get; } 11 | 12 | public ColumnNameAttribute(string name) 13 | { 14 | Name = name; 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /netcore/src/Koralium.Shared/Attributes/KoraliumIgnoreAttribute.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | using System; 15 | 16 | namespace Koralium 17 | { 18 | [AttributeUsage(AttributeTargets.Property)] 19 | public class KoraliumIgnoreAttribute : Attribute 20 | { 21 | 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /netcore/src/Koralium.Shared/IReadSqlParameters.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | using System.Collections.Generic; 15 | 16 | namespace Koralium.Shared 17 | { 18 | public interface IReadSqlParameters : IEnumerable> 19 | { 20 | bool TryGetParameter(string name, out SqlParameter sqlParameter); 21 | 22 | IEnumerable Keys { get; } 23 | 24 | IEnumerable Values { get; } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /netcore/src/Koralium.Shared/Koralium.Shared.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | LICENSE 6 | Koralium 7 | https://github.com/koralium/Koralium 8 | https://github.com/koralium/Koralium 9 | 10 | 11 | 12 | 13 | True 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | all 23 | runtime; build; native; contentfiles; analyzers; buildtransitive 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /netcore/src/Koralium.Shared/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | using System.Runtime.CompilerServices; 15 | 16 | 17 | [assembly: InternalsVisibleTo("Koralium.SqlToExpression")] 18 | 19 | -------------------------------------------------------------------------------- /netcore/src/Koralium.Shared/SqlErrorException.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | using System; 15 | 16 | namespace Koralium.Shared 17 | { 18 | public class SqlErrorException : Exception 19 | { 20 | public SqlErrorException(string message) 21 | : base(message) 22 | { 23 | 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /netcore/src/Koralium.Shared/Utils/EnumUtils.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace Koralium.Shared.Utils 6 | { 7 | internal static class EnumUtils 8 | { 9 | public static object ConvertToEnum(object val, Type enumType) 10 | { 11 | if (val is string stringValue) 12 | { 13 | return Enum.Parse(enumType, stringValue, true); 14 | } 15 | else 16 | { 17 | return Enum.ToObject(enumType, val); 18 | } 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /netcore/src/Koralium.SqlParser.ANTLR/ANTLR/antlr.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koralium/Koralium/81712b0407c4c746b86b34b8365a797fb1238536/netcore/src/Koralium.SqlParser.ANTLR/ANTLR/antlr.jar -------------------------------------------------------------------------------- /netcore/src/Koralium.SqlParser.ANTLR/ANTLR/generate.bat: -------------------------------------------------------------------------------- 1 | java -jar .\antlr.jar -Dlanguage=CSharp -o generated -visitor ./KoraliumLexer.g4 2 | java -jar .\antlr.jar -Dlanguage=CSharp -o generated -visitor ./KoraliumParser.g4 -------------------------------------------------------------------------------- /netcore/src/Koralium.SqlParser.ANTLR/Koralium.SqlParser.ANTLR.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.1 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /netcore/src/Koralium.SqlParser/Errors/SqlParserError.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | namespace Koralium.SqlParser.Errors 15 | { 16 | public class SqlParserError 17 | { 18 | public SqlParserError(string message) 19 | { 20 | Message = message; 21 | } 22 | 23 | public string Message { get; } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /netcore/src/Koralium.SqlParser/Expressions/BinaryType.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | namespace Koralium.SqlParser.Expressions 15 | { 16 | public enum BinaryType 17 | { 18 | Add = 0, 19 | Subtract = 1, 20 | Multiply = 2, 21 | Divide = 3, 22 | Modulo = 4, 23 | BitwiseAnd = 5, 24 | BitwiseOr = 6, 25 | BitwiseXor = 7 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /netcore/src/Koralium.SqlParser/Expressions/BooleanBinaryType.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | namespace Koralium.SqlParser.Expressions 15 | { 16 | public enum BooleanBinaryType 17 | { 18 | AND = 0, 19 | OR = 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /netcore/src/Koralium.SqlParser/Expressions/BooleanComparisonType.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | namespace Koralium.SqlParser.Expressions 15 | { 16 | public enum BooleanComparisonType 17 | { 18 | Equals = 0, 19 | GreaterThan = 1, 20 | LessThan = 2, 21 | GreaterThanOrEqualTo = 3, 22 | LessThanOrEqualTo = 4, 23 | NotEqualTo = 5 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /netcore/src/Koralium.SqlParser/Expressions/BooleanExpression.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | namespace Koralium.SqlParser.Expressions 15 | { 16 | public abstract class BooleanExpression : SqlExpression 17 | { 18 | 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /netcore/src/Koralium.SqlParser/Expressions/ScalarExpression.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | namespace Koralium.SqlParser.Expressions 15 | { 16 | public abstract class ScalarExpression : SqlExpression 17 | { 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /netcore/src/Koralium.SqlParser/Expressions/SelectExpression.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | using System; 15 | 16 | namespace Koralium.SqlParser.Expressions 17 | { 18 | public abstract class SelectExpression : SqlExpression 19 | { 20 | public string Alias { get; set; } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /netcore/src/Koralium.SqlParser/Expressions/SqlExpression.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | namespace Koralium.SqlParser.Expressions 15 | { 16 | public abstract class SqlExpression : SqlNode 17 | { 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /netcore/src/Koralium.SqlParser/Extensions/SqlNodeExtensions.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | using Koralium.SqlParser.Visitor; 15 | 16 | namespace Koralium.SqlParser 17 | { 18 | public static class SqlNodeExtensions 19 | { 20 | public static string Print(this SqlNode sqlNode) 21 | { 22 | PrintVisitor printVisitor = new PrintVisitor(); 23 | return printVisitor.Print(sqlNode); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /netcore/src/Koralium.SqlParser/From/TableReference.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | namespace Koralium.SqlParser.From 15 | { 16 | public abstract class TableReference : SqlNode 17 | { 18 | public string Alias { get; set; } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /netcore/src/Koralium.SqlParser/GroupBy/Group.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | namespace Koralium.SqlParser.GroupBy 15 | { 16 | public abstract class Group : SqlNode 17 | { 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /netcore/src/Koralium.SqlParser/Interfaces/ISqlParser.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | using Koralium.SqlParser.Errors; 15 | using Koralium.SqlParser.Expressions; 16 | using Koralium.SqlParser.Statements; 17 | using System.Collections.Generic; 18 | 19 | namespace Koralium.SqlParser 20 | { 21 | public interface ISqlParser 22 | { 23 | StatementList Parse(string text); 24 | 25 | StatementList Parse(string text, out IReadOnlyList errors); 26 | 27 | BooleanExpression ParseFilter(string text, out IReadOnlyList errors); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /netcore/src/Koralium.SqlParser/Koralium.SqlParser.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.1 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /netcore/src/Koralium.SqlParser/Literals/Literal.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | using Koralium.SqlParser.Expressions; 15 | 16 | namespace Koralium.SqlParser.Literals 17 | { 18 | public abstract class Literal : ScalarExpression 19 | { 20 | public abstract object GetValue(); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /netcore/src/Koralium.SqlParser/OrderBy/OrderElement.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | namespace Koralium.SqlParser.OrderBy 15 | { 16 | public abstract class OrderElement : SqlNode 17 | { 18 | public bool Ascending { get; set; } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /netcore/src/Koralium.SqlParser/SqlNode.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | using Koralium.SqlParser.Visitor; 15 | 16 | namespace Koralium.SqlParser 17 | { 18 | public abstract class SqlNode 19 | { 20 | public abstract void Accept(KoraliumSqlVisitor visitor); 21 | 22 | public abstract SqlNode Clone(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /netcore/src/Koralium.SqlParser/Statements/Statement.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | namespace Koralium.SqlParser.Statements 15 | { 16 | public abstract class Statement : SqlNode 17 | { 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /netcore/src/Koralium.SqlToExpression/Executors/AggregateFunction/IAggregateFunctionExecutor.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | using Koralium.SqlToExpression.Executors.Select; 15 | using Koralium.SqlToExpression.Stages.ExecuteStages; 16 | using System.Linq; 17 | using System.Threading.Tasks; 18 | 19 | namespace Koralium.SqlToExpression.Executors.AggregateFunction 20 | { 21 | public interface IAggregateFunctionExecutor 22 | { 23 | ValueTask Execute(IQueryable queryable, ExecuteAggregateFunctionStage executeAggregateFunctionStage); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /netcore/src/Koralium.SqlToExpression/Executors/AggregateFunction/IAggregateFunctionExecutorFactory.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | using Koralium.SqlToExpression.Stages.ExecuteStages; 15 | 16 | namespace Koralium.SqlToExpression.Executors.AggregateFunction 17 | { 18 | public interface IAggregateFunctionExecutorFactory 19 | { 20 | IAggregateFunctionExecutor GetAggregateFunctionExecutor(ExecuteAggregateFunctionStage executeAggregateFunctionStage); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /netcore/src/Koralium.SqlToExpression/Executors/AggregateFunction/ObjectExtensions.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | namespace Koralium.SqlToExpression.Executors.AggregateFunction 15 | { 16 | internal static class ObjectExtensions 17 | { 18 | public static T Cast(this object obj) 19 | { 20 | return (T)obj; 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /netcore/src/Koralium.SqlToExpression/Executors/Distinct/IDistinctExecutor.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | using Koralium.SqlToExpression.Stages.ExecuteStages; 15 | using System.Linq; 16 | using System.Threading.Tasks; 17 | 18 | namespace Koralium.SqlToExpression.Executors 19 | { 20 | public interface IDistinctExecutor 21 | { 22 | ValueTask Execute(IQueryable queryable, ExecuteDistinctStage executeDistinctStage); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /netcore/src/Koralium.SqlToExpression/Executors/Distinct/IDistinctExecutorFactory.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | using Koralium.SqlToExpression.Stages.ExecuteStages; 15 | 16 | namespace Koralium.SqlToExpression.Executors 17 | { 18 | public interface IDistinctExecutorFactory 19 | { 20 | IDistinctExecutor GetDistinctExecutor(ExecuteDistinctStage executeDistinctStage); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /netcore/src/Koralium.SqlToExpression/Executors/FromTable/IFromTableExecutor.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | using Koralium.SqlToExpression.Stages.ExecuteStages; 15 | using System.Linq; 16 | using System.Threading.Tasks; 17 | 18 | namespace Koralium.SqlToExpression.Executors 19 | { 20 | /// 21 | /// Executor that gets a table as an IQueryable 22 | /// 23 | public interface IFromTableExecutor 24 | { 25 | ValueTask Execute(ISqlTableResolver tableResolver, ExecuteFromTableStage executeFromTableStage, object additionalData); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /netcore/src/Koralium.SqlToExpression/Executors/GroupBy/IGroupByExecutor.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | using Koralium.SqlToExpression.Stages.ExecuteStages; 15 | using System.Linq; 16 | using System.Threading.Tasks; 17 | 18 | namespace Koralium.SqlToExpression.Executors 19 | { 20 | public interface IGroupByExecutor 21 | { 22 | ValueTask Execute(IQueryable queryable, ExecuteGroupByStage groupByStage); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /netcore/src/Koralium.SqlToExpression/Executors/GroupBy/IGroupByExecutorFactory.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | using Koralium.SqlToExpression.Stages.ExecuteStages; 15 | 16 | namespace Koralium.SqlToExpression.Executors 17 | { 18 | public interface IGroupByExecutorFactory 19 | { 20 | IGroupByExecutor GetGroupByExecutor(ExecuteGroupByStage groupByStage); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /netcore/src/Koralium.SqlToExpression/Executors/Offset/IOffsetExecutor.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | using Koralium.SqlToExpression.Stages.ExecuteStages; 15 | using System.Linq; 16 | using System.Threading.Tasks; 17 | 18 | namespace Koralium.SqlToExpression.Executors.Offset 19 | { 20 | public interface IOffsetExecutor 21 | { 22 | ValueTask Execute(IQueryable queryable, ExecuteOffsetStage executeOffsetStage); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /netcore/src/Koralium.SqlToExpression/Executors/Offset/IOffsetExecutorFactory.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | using Koralium.SqlToExpression.Stages.ExecuteStages; 15 | 16 | namespace Koralium.SqlToExpression.Executors.Offset 17 | { 18 | public interface IOffsetExecutorFactory 19 | { 20 | IOffsetExecutor GetOffsetExecutor(ExecuteOffsetStage executeOffsetStage); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /netcore/src/Koralium.SqlToExpression/Executors/OrderBy/IOrderByExecutor.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | using Koralium.SqlToExpression.Stages.ExecuteStages; 15 | using System.Linq; 16 | using System.Threading.Tasks; 17 | 18 | namespace Koralium.SqlToExpression.Executors 19 | { 20 | public interface IOrderByExecutor 21 | { 22 | ValueTask Execute(IQueryable queryable, ExecuteOrderByStage executeOrderByStage); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /netcore/src/Koralium.SqlToExpression/Executors/OrderBy/IOrderByExecutorFactory.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | using Koralium.SqlToExpression.Stages.ExecuteStages; 15 | 16 | namespace Koralium.SqlToExpression.Executors 17 | { 18 | public interface IOrderByExecutorFactory 19 | { 20 | IOrderByExecutor GetOrderByExecutor(ExecuteOrderByStage executeOrderByStage); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /netcore/src/Koralium.SqlToExpression/Executors/Select/ISelectExecutor.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | using Koralium.SqlToExpression.Executors.Select; 15 | using Koralium.SqlToExpression.Stages.ExecuteStages; 16 | using System.Linq; 17 | using System.Threading.Tasks; 18 | 19 | namespace Koralium.SqlToExpression.Executors 20 | { 21 | public interface ISelectExecutor 22 | { 23 | ValueTask Execute(IQueryable queryable, ExecuteSelectStage selectStage); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /netcore/src/Koralium.SqlToExpression/Executors/Select/ISelectExecutorFactory.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | using Koralium.SqlToExpression.Stages.ExecuteStages; 15 | 16 | 17 | namespace Koralium.SqlToExpression.Executors 18 | { 19 | public interface ISelectExecutorFactory 20 | { 21 | ISelectExecutor GetSelectExecutor(ExecuteSelectStage selectStage); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /netcore/src/Koralium.SqlToExpression/Executors/Where/IWhereExecutor.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | using Koralium.SqlToExpression.Stages.ExecuteStages; 15 | using System.Linq; 16 | using System.Threading.Tasks; 17 | 18 | namespace Koralium.SqlToExpression.Executors 19 | { 20 | public interface IWhereExecutor 21 | { 22 | ValueTask Execute(IQueryable queryable, ExecuteWhereStage executeWhereStage); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /netcore/src/Koralium.SqlToExpression/Executors/Where/IWhereExecutorFactory.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | using Koralium.SqlToExpression.Stages.ExecuteStages; 15 | 16 | namespace Koralium.SqlToExpression.Executors 17 | { 18 | public interface IWhereExecutorFactory 19 | { 20 | IWhereExecutor GetWhereExecutor(ExecuteWhereStage executeWhereStage); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /netcore/src/Koralium.SqlToExpression/Interfaces/ISqlTableResolver.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | using System.Linq; 15 | using System.Threading.Tasks; 16 | 17 | namespace Koralium.SqlToExpression 18 | { 19 | public interface ISqlTableResolver 20 | { 21 | ValueTask ResolveTableName(string name, object additionalData, IQueryOptions queryOptions); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /netcore/src/Koralium.SqlToExpression/Models/AggregationType.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | namespace Koralium.SqlToExpression.Models 15 | { 16 | enum AggregationType 17 | { 18 | Sum = 0 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /netcore/src/Koralium.SqlToExpression/Models/BinaryExpressionType.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | namespace Koralium.SqlToExpression.Models 15 | { 16 | public enum BinaryExpressionType 17 | { 18 | Add = 0, 19 | Subtract = 1, 20 | Multiply = 2, 21 | Divide = 3, 22 | Modulo = 4, 23 | BitwiseAnd = 5, 24 | BitwiseOr = 6, 25 | BitwiseXor = 7 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /netcore/src/Koralium.SqlToExpression/Models/SchemaResult.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | using System.Collections.Immutable; 15 | 16 | namespace Koralium.SqlToExpression.Models 17 | { 18 | public class SchemaResult 19 | { 20 | public string TableName { get; } 21 | 22 | public IImmutableList Columns { get; } 23 | 24 | public SchemaResult(string tableName, IImmutableList columns) 25 | { 26 | TableName = tableName; 27 | Columns = columns; 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /netcore/src/Koralium.SqlToExpression/Models/SortItem.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | using System.Linq.Expressions; 15 | 16 | namespace Koralium.SqlToExpression.Models 17 | { 18 | public class SortItem 19 | { 20 | public Expression Expression { get; } 21 | 22 | public bool Descending { get; } 23 | 24 | internal SortItem(Expression expression, bool descending) 25 | { 26 | Expression = expression; 27 | Descending = descending; 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /netcore/src/Koralium.SqlToExpression/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | using System.Runtime.CompilerServices; 15 | 16 | [assembly: InternalsVisibleTo("Koralium.SqlToExpression.Tests")] -------------------------------------------------------------------------------- /netcore/src/Koralium.SqlToExpression/Providers/DefaultSearchExpressionProvider.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | using Koralium.Shared; 15 | using Koralium.SqlToExpression.Interfaces; 16 | using System.Linq.Expressions; 17 | 18 | namespace Koralium.SqlToExpression.Providers 19 | { 20 | public class DefaultSearchExpressionProvider : ISearchExpressionProvider 21 | { 22 | public Expression GetSearchExpression(ISearchParameters searchParameters) 23 | { 24 | throw new SqlErrorException("Search is not implemented for this table"); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /netcore/src/Koralium.SqlToExpression/QueryResult.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | using System.Collections.Immutable; 15 | using System.Linq; 16 | 17 | namespace Koralium.SqlToExpression 18 | { 19 | public class QueryResult 20 | { 21 | public IQueryable Result { get; } 22 | 23 | public IImmutableList Columns { get; } 24 | 25 | internal QueryResult(IQueryable result, IImmutableList columns) 26 | { 27 | Result = result; 28 | Columns = columns; 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /netcore/src/Koralium.SqlToExpression/Stages/CompileStages/IQueryStage.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | using Koralium.SqlToExpression.Models; 15 | using System; 16 | using System.Linq.Expressions; 17 | 18 | namespace Koralium.SqlToExpression.Stages.CompileStages 19 | { 20 | internal interface IQueryStage 21 | { 22 | SqlTypeInfo TypeInfo { get; } 23 | 24 | ParameterExpression ParameterExpression { get; } 25 | 26 | Type CurrentType { get; } 27 | 28 | FromAliases FromAliases { get; } 29 | 30 | void Accept(IQueryStageVisitor visitor); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /netcore/src/Koralium.SqlToExpression/Stages/ExecuteStages/IExecuteStage.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | using Koralium.SqlToExpression.Executors; 15 | using System.Linq; 16 | using System.Threading.Tasks; 17 | 18 | namespace Koralium.SqlToExpression.Stages.ExecuteStages 19 | { 20 | public interface IExecuteStage 21 | { 22 | ValueTask Accept(IQueryExecutor queryExecutor); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /netcore/src/Koralium.SqlToExpression/Visitors/Select/ISelectVisitor.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | using Koralium.SqlParser; 15 | using System.Collections.Generic; 16 | using System.Reflection; 17 | 18 | namespace Koralium.SqlToExpression.Visitors.Select 19 | { 20 | internal interface ISelectVisitor 21 | { 22 | IReadOnlyList SelectExpressions { get; } 23 | 24 | IEnumerable UsedProperties { get; } 25 | 26 | void VisitSelect(SqlNode sqlNode); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /netcore/src/Koralium.TestFramework/Koralium.TestFramework.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.1 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /netcore/src/Koralium.TestFramework/TestContextSettings.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | namespace Koralium.TestFramework 15 | { 16 | public class TestContextSettings 17 | { 18 | public string TableName { get; set; } 19 | 20 | public string Url { get; set; } 21 | 22 | public string AccessToken { get; set; } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /netcore/src/Koralium.Transport.ArrowFlight/Extensions/KoraliumFlightEndpointRouteBuilderExtensions.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | using Microsoft.AspNetCore.Builder; 15 | using Microsoft.AspNetCore.Routing; 16 | 17 | namespace Koralium.Transport.ArrowFlight.Extensions 18 | { 19 | public static class KoraliumFlightEndpointRouteBuilderExtensions 20 | { 21 | public static IEndpointConventionBuilder MapKoraliumArrowFlight(this IEndpointRouteBuilder endpointRouteBuilder) 22 | { 23 | return endpointRouteBuilder.MapFlightEndpoint(); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /netcore/src/Koralium.Transport.Json/Encoders/BinaryEncoder.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | using System.Text.Json; 15 | 16 | namespace Koralium.Transport.Json.Encoders 17 | { 18 | internal class BinaryEncoder : PrimitiveEncoder 19 | { 20 | public BinaryEncoder(Column column) : base(column) 21 | { 22 | } 23 | 24 | private protected override void WriteValue(in Utf8JsonWriter writer, in object val) 25 | { 26 | writer.WriteBase64StringValue((byte[])val); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /netcore/src/Koralium.Transport.Json/Encoders/BooleanEncoder.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | using System.Text.Json; 15 | 16 | namespace Koralium.Transport.Json.Encoders 17 | { 18 | class BooleanEncoder : PrimitiveEncoder 19 | { 20 | public BooleanEncoder(Column column) : base(column) 21 | { 22 | } 23 | 24 | private protected override void WriteValue(in Utf8JsonWriter writer, in object val) 25 | { 26 | writer.WriteBooleanValue((bool)val); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /netcore/src/Koralium.Transport.Json/Encoders/DateTimeEncoder.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | using System; 15 | using System.Text.Json; 16 | 17 | namespace Koralium.Transport.Json.Encoders 18 | { 19 | class DateTimeEncoder : PrimitiveEncoder 20 | { 21 | public DateTimeEncoder(Column column) : base(column) 22 | { 23 | } 24 | 25 | private protected override void WriteValue(in Utf8JsonWriter writer, in object val) 26 | { 27 | writer.WriteStringValue((DateTime)val); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /netcore/src/Koralium.Transport.Json/Encoders/Decimal128Encoder.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using System.Text.Json; 5 | 6 | namespace Koralium.Transport.Json.Encoders 7 | { 8 | class Decimal128Encoder : PrimitiveEncoder 9 | { 10 | public Decimal128Encoder(Column column) : base(column) 11 | { 12 | } 13 | 14 | private protected override void WriteValue(in Utf8JsonWriter writer, in object val) 15 | { 16 | writer.WriteNumberValue((decimal)val); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /netcore/src/Koralium.Transport.Json/Encoders/DoubleEncoder.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | using System.Text.Json; 15 | 16 | namespace Koralium.Transport.Json.Encoders 17 | { 18 | class DoubleEncoder : PrimitiveEncoder 19 | { 20 | public DoubleEncoder(Column column) : base(column) 21 | { 22 | } 23 | 24 | private protected override void WriteValue(in Utf8JsonWriter writer, in object val) 25 | { 26 | writer.WriteNumberValue((double)val); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /netcore/src/Koralium.Transport.Json/Encoders/FloatEncoder.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | using System.Text.Json; 15 | 16 | namespace Koralium.Transport.Json.Encoders 17 | { 18 | class FloatEncoder : PrimitiveEncoder 19 | { 20 | public FloatEncoder(Column column) : base(column) 21 | { 22 | } 23 | 24 | private protected override void WriteValue(in Utf8JsonWriter writer, in object val) 25 | { 26 | writer.WriteNumberValue((float)val); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /netcore/src/Koralium.Transport.Json/Encoders/IJsonEncoder.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | using System; 15 | using System.Text.Json; 16 | 17 | namespace Koralium.Transport.Json.Encoders 18 | { 19 | public interface IJsonEncoder 20 | { 21 | internal Func GetValueFunc { get; } 22 | void Encode(in Utf8JsonWriter utf8JsonWriter, in object row); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /netcore/src/Koralium.Transport.Json/Encoders/Int16Encoder.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | using System.Text.Json; 15 | 16 | namespace Koralium.Transport.Json.Encoders 17 | { 18 | class Int16Encoder : PrimitiveEncoder 19 | { 20 | public Int16Encoder(Column column) : base(column) 21 | { 22 | } 23 | 24 | private protected override void WriteValue(in Utf8JsonWriter writer, in object val) 25 | { 26 | writer.WriteNumberValue((short)val); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /netcore/src/Koralium.Transport.Json/Encoders/Int32Encoder.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | using System.Text.Json; 15 | 16 | namespace Koralium.Transport.Json.Encoders 17 | { 18 | class Int32Encoder : PrimitiveEncoder 19 | { 20 | public Int32Encoder(Column column) : base(column) 21 | { 22 | } 23 | 24 | private protected override void WriteValue(in Utf8JsonWriter writer, in object val) 25 | { 26 | writer.WriteNumberValue((int)val); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /netcore/src/Koralium.Transport.Json/Encoders/Int64Encoder.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | using System.Text.Json; 15 | 16 | namespace Koralium.Transport.Json.Encoders 17 | { 18 | class Int64Encoder : PrimitiveEncoder 19 | { 20 | public Int64Encoder(Column column) : base(column) 21 | { 22 | } 23 | 24 | private protected override void WriteValue(in Utf8JsonWriter writer, in object val) 25 | { 26 | writer.WriteNumberValue((long)val); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /netcore/src/Koralium.Transport.Json/Encoders/StringEncoder.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | using System.Text.Json; 15 | 16 | namespace Koralium.Transport.Json.Encoders 17 | { 18 | class StringEncoder : PrimitiveEncoder 19 | { 20 | public StringEncoder(Column column) : base(column) 21 | { 22 | } 23 | 24 | private protected override void WriteValue(in Utf8JsonWriter writer, in object val) 25 | { 26 | writer.WriteStringValue((string)val); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /netcore/src/Koralium.Transport.Json/Encoders/UInt32Encoder.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | using System.Text.Json; 15 | 16 | namespace Koralium.Transport.Json.Encoders 17 | { 18 | class UInt32Encoder : PrimitiveEncoder 19 | { 20 | public UInt32Encoder(Column column) : base(column) 21 | { 22 | } 23 | 24 | private protected override void WriteValue(in Utf8JsonWriter writer, in object val) 25 | { 26 | writer.WriteNumberValue((uint)val); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /netcore/src/Koralium.Transport.Json/Encoders/UInt64Encoder.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | using System.Text.Json; 15 | 16 | namespace Koralium.Transport.Json.Encoders 17 | { 18 | class UInt64Encoder : PrimitiveEncoder 19 | { 20 | public UInt64Encoder(Column column) : base(column) 21 | { 22 | } 23 | 24 | private protected override void WriteValue(in Utf8JsonWriter writer, in object val) 25 | { 26 | writer.WriteNumberValue((ulong)val); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /netcore/src/Koralium.Transport.Json/Encoders/UInt8Encoder.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | using System.Text.Json; 15 | 16 | namespace Koralium.Transport.Json.Encoders 17 | { 18 | class UInt8Encoder : PrimitiveEncoder 19 | { 20 | public UInt8Encoder(Column column) : base(column) 21 | { 22 | } 23 | 24 | private protected override void WriteValue(in Utf8JsonWriter writer, in object val) 25 | { 26 | writer.WriteNumberValue((byte)val); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /netcore/src/Koralium.Transport.Json/Koralium.Transport.Json.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp3.1 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /netcore/src/Koralium.Transport.LegacyGrpc.Abstractions/Koralium.Transport.LegacyGrpc.Abstractions.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | all 16 | runtime; build; native; contentfiles; analyzers; buildtransitive 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /netcore/src/Koralium.Transport.LegacyGrpc/Extensions/LegacyGrpcServiceCollectionExtensions.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | using Microsoft.Extensions.DependencyInjection; 15 | 16 | namespace Koralium.Transport.LegacyGrpc.Extensions 17 | { 18 | public static class LegacyGrpcServiceCollectionExtensions 19 | { 20 | public static IServiceCollection AddKoraliumLegacyGrpcTransport(this IServiceCollection services) 21 | { 22 | services.AddScoped(); 23 | 24 | return services; 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /netcore/src/Koralium.Transport.LegacyGrpc/Interfaces/IDecoder.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | using Koralium.Grpc; 15 | using System; 16 | using System.Text; 17 | 18 | namespace Koralium.Transport.LegacyGrpc.Interfaces 19 | { 20 | public interface IDecoder 21 | { 22 | Decoder Create(int columnId, Column column); 23 | 24 | void NewPage(Page page); 25 | 26 | void Decode(Block block, Action setter, int? numberOfRows = int.MaxValue); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /netcore/src/Koralium.Transport.LegacyGrpc/Interfaces/IEncoder.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | using Koralium.Grpc; 15 | 16 | namespace Koralium.Transport.LegacyGrpc.Interfaces 17 | { 18 | public interface IEncoder 19 | { 20 | Block CreateBlock(Page page); 21 | 22 | uint Encode(in object value, in Block block, in int rowNumber); 23 | 24 | void Finish(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /netcore/src/Koralium.Transport.LegacyGrpc/Koralium.Transport.LegacyGrpc.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp3.1 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /netcore/src/Koralium.Transport.RowLevelSecurity/FormatConverters/Cubejs/Models/BaseQueryFilter.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | 15 | namespace Koralium.Transport.RowLevelSecurity.FormatConverters.Cubejs.Models 16 | { 17 | class BaseQueryFilter 18 | { 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /netcore/src/Koralium.Transport.RowLevelSecurity/FormatConverters/Cubejs/Models/BinaryQueryFilter.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | using System.Collections.Generic; 15 | 16 | namespace Koralium.Transport.RowLevelSecurity.FormatConverters.Cubejs.Models 17 | { 18 | class BinaryQueryFilter : BaseQueryFilter 19 | { 20 | public List Or { get; set; } 21 | 22 | public List And { get; set; } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /netcore/src/Koralium.Transport.RowLevelSecurity/FormatConverters/Cubejs/Models/QueryFilter.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | using System.Collections.Generic; 15 | 16 | namespace Koralium.Transport.RowLevelSecurity.FormatConverters.Cubejs.Models 17 | { 18 | class QueryFilter : BaseQueryFilter 19 | { 20 | public string Member { get; set; } 21 | 22 | public ComparisonOperator Operator { get; set; } 23 | 24 | public List Values { get; set; } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /netcore/src/Koralium.Transport.RowLevelSecurity/FormatConverters/Elasticsearch/Models/BoolOperation.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | 15 | namespace Koralium.Transport.RowLevelSecurity.FormatConverters.Elasticsearch.Models 16 | { 17 | abstract class BoolOperation 18 | { 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /netcore/src/Koralium.Transport.RowLevelSecurity/FormatConverters/Elasticsearch/Models/Term.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | 15 | namespace Koralium.Transport.RowLevelSecurity.FormatConverters.Elasticsearch.Models 16 | { 17 | class Term : BoolOperation 18 | { 19 | public string FieldName { get; set; } 20 | 21 | public object Value { get; set; } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /netcore/src/Koralium.Transport.RowLevelSecurity/FormatConverters/Elasticsearch/Models/Terms.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | using System.Collections.Generic; 15 | 16 | namespace Koralium.Transport.RowLevelSecurity.FormatConverters.Elasticsearch.Models 17 | { 18 | class Terms : BoolOperation 19 | { 20 | public string FieldName { get; set; } 21 | 22 | public List Values { get; set; } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /netcore/src/Koralium.Transport.RowLevelSecurity/FormatConverters/Sql/SqlFormat.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | using Koralium.SqlParser; 15 | using Koralium.SqlParser.Expressions; 16 | 17 | namespace Koralium.Transport.RowLevelSecurity.FormatConverters 18 | { 19 | static class SqlFormat 20 | { 21 | public static string Format(BooleanExpression booleanExpression) 22 | { 23 | return booleanExpression.Print(); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /netcore/src/Koralium.Transport.RowLevelSecurity/Koralium.Transport.RowLevelSecurity.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp3.1 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | all 16 | runtime; build; native; contentfiles; analyzers; buildtransitive 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /netcore/src/Koralium.Transport.RowLevelSecurity/Protos/RowLevelSecurityService.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | 4 | option csharp_namespace = "Koralium.Transport.RowLevelSecurity"; 5 | 6 | service KoraliumRowLevelSecurity { 7 | rpc GetRowLevelSecurityFilter (RowLevelSecurityRequest) returns (RowLevelSecurityResponse); 8 | } 9 | 10 | enum Format { 11 | sql = 0; 12 | elasticsearch = 1; 13 | cubejs = 2; 14 | } 15 | 16 | message RowLevelSecurityRequest { 17 | 18 | // Table name to get row level security filter for 19 | string tableName = 1; 20 | 21 | //Which format to output the filter in 22 | Format format = 3; 23 | 24 | oneof formatOptions { 25 | SqlOptions sqlOptions = 4; 26 | ElasticSearchOptions elasticSearchOptions = 5; 27 | CubeJsOptions cubejsOptions = 6; 28 | } 29 | } 30 | 31 | message RowLevelSecurityResponse { 32 | string filter = 1; 33 | } 34 | 35 | message SqlOptions { 36 | string tableAlias = 1; 37 | } 38 | 39 | message ElasticSearchOptions { 40 | bool lowerCaseStringValues = 1; 41 | } 42 | 43 | message CubeJsOptions { 44 | string cubeName = 1; 45 | bool lowerCaseFirstMemberCharacter = 2; 46 | } -------------------------------------------------------------------------------- /netcore/src/Koralium.Transport.RowLevelSecurity/README.md: -------------------------------------------------------------------------------- 1 | # Transport for Row level security 2 | 3 | This transport library allows a caller to get what filters should be applied to a dataset, given a specific user. 4 | This is useful if the data is cached elsewhere, for instance in an aggregated form, but still being able to 5 | apply the same row level security as the data service. -------------------------------------------------------------------------------- /netcore/src/Koralium.Transport/ColumnType.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | namespace Koralium.Transport 15 | { 16 | public enum ColumnType 17 | { 18 | Object = 0, 19 | List = 1, 20 | Bool = 2, 21 | Double = 3, 22 | Float = 4, 23 | Int32 = 5, 24 | Int64 = 6, 25 | String = 7, 26 | DateTime = 8, 27 | Short = 9, 28 | UInt32 = 10, 29 | UInt64 = 11, 30 | Byte = 12, 31 | Binary = 13, 32 | Enum = 14, 33 | Decimal = 15 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /netcore/src/Koralium.Transport/Extensions/TransportTableExtensions.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | namespace Koralium.Transport.Extensions 15 | { 16 | public static class TransportTableExtensions 17 | { 18 | public static string SelectAllColumnsStatement(this Transport.Table table) 19 | { 20 | return $"select * from {table.Name}"; 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /netcore/src/Koralium.Transport/Koralium.Transport.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.1 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /netcore/src/Koralium.Transport/Table.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | namespace Koralium.Transport 15 | { 16 | public class Table 17 | { 18 | public string Name { get; } 19 | 20 | public Table(string name) 21 | { 22 | Name = name; 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /netcore/src/Koralium.Transport/TransportServiceLocation.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | 15 | namespace Koralium.Transport 16 | { 17 | public class TransportServiceLocation 18 | { 19 | public string Host { get; } 20 | 21 | public bool Tls { get; } 22 | 23 | public TransportServiceLocation( 24 | string host, 25 | bool tls) 26 | { 27 | Host = host; 28 | Tls = tls; 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /netcore/src/Koralium/Koralium.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp3.1 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /netcore/tests/Data.Koralium.Tests/testappsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "TestDataLocation": "../../../../../../TestData" 3 | } 4 | -------------------------------------------------------------------------------- /netcore/tests/EntityFrameworkCore.Koralium.Benchmarks/EntityFrameworkCore.Koralium.Benchmarks.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | netcoreapp3.1 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | PreserveNewest 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /netcore/tests/EntityFrameworkCore.Koralium.Benchmarks/Program.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | using BenchmarkDotNet.Running; 15 | 16 | namespace EntityFrameworkCore.Koralium.Benchmarks 17 | { 18 | static class Program 19 | { 20 | static void Main(string[] args) 21 | { 22 | var webFactory = new TestWebFactory(); 23 | var summary = BenchmarkRunner.Run(typeof(Program).Assembly); 24 | webFactory.Stop(); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /netcore/tests/EntityFrameworkCore.Koralium.Benchmarks/testappsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "TestDataLocation": "../../../../../../TestData" 3 | } 4 | -------------------------------------------------------------------------------- /netcore/tests/EntityFrameworkCore.Koralium.Tests/testappsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "TestDataLocation": "../../../../../../TestData" 3 | } 4 | -------------------------------------------------------------------------------- /netcore/tests/Koralium.Benchmarks/Koralium.Benchmarks.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | netcoreapp3.1 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | PreserveNewest 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /netcore/tests/Koralium.Benchmarks/Program.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | using BenchmarkDotNet.Running; 15 | 16 | namespace Koralium.Benchmarks 17 | { 18 | class Program 19 | { 20 | static void Main(string[] args) 21 | { 22 | //var webFactory = new TestWebFactory(); 23 | var summary = BenchmarkSwitcher.FromAssembly(typeof(Program).Assembly).Run(args); 24 | //webFactory.Stop(); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /netcore/tests/Koralium.Benchmarks/testappsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Koralium": "Warning", 5 | "Default": "Warning", 6 | "Microsoft": "Warning", 7 | "Microsoft.Hosting.Lifetime": "Warning" 8 | } 9 | }, 10 | "TestDataLocation": "../../../../../../../../../../TestData" 11 | } 12 | -------------------------------------------------------------------------------- /netcore/tests/Koralium.Core.Tests/Koralium.Core.Tests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp3.1 5 | 6 | false 7 | 8 | 9 | 10 | 11 | all 12 | runtime; build; native; contentfiles; analyzers; buildtransitive 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /netcore/tests/Koralium.SqlParser.ANTLR.Benchmarks/Koralium.SqlParser.ANTLR.Benchmarks.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | netcoreapp3.1 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /netcore/tests/Koralium.SqlParser.ANTLR.Tests/Koralium.SqlParser.ANTLR.Tests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp3.1 5 | 6 | false 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /netcore/tests/Koralium.SqlParser.ANTLR.Tests/SmokeTests.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | using Koralium.SqlParser.SmokeTests; 15 | using NUnit.Framework; 16 | 17 | namespace Koralium.SqlParser.ANTLR.Tests 18 | { 19 | [TestFixture] 20 | public class SmokeTests : SmokeTestsBase 21 | { 22 | protected override ISqlParser Parser => new Koralium.SqlParser.ANTLR.AntlrSqlParser(); 23 | } 24 | } -------------------------------------------------------------------------------- /netcore/tests/Koralium.SqlParser.SmokeTests/Koralium.SqlParser.SmokeTests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.1 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /netcore/tests/Koralium.SqlParser.SmokeTests/SmokeTestsBase.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | namespace Koralium.SqlParser.SmokeTests 15 | { 16 | public abstract partial class SmokeTestsBase 17 | { 18 | protected abstract ISqlParser Parser { get; } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /netcore/tests/Koralium.SqlParser.Tests/FromAcceptTests.cs: -------------------------------------------------------------------------------- 1 | using Koralium.SqlParser.From; 2 | using Koralium.SqlParser.Visitor; 3 | using Moq; 4 | using NUnit.Framework; 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Text; 8 | 9 | namespace Koralium.SqlParser.Tests 10 | { 11 | public class FromAcceptTests 12 | { 13 | [Test] 14 | public void TestFromTableReferenceAccept() 15 | { 16 | Mock mock = new Mock(); 17 | FromTableReference fromTableReference = new FromTableReference(); 18 | 19 | fromTableReference.Accept(mock.Object); 20 | mock.Verify(x => x.VisitFromTableReference(fromTableReference)); 21 | } 22 | 23 | [Test] 24 | public void TestSubqueryAccept() 25 | { 26 | Mock mock = new Mock(); 27 | Subquery subquery = new Subquery(); 28 | 29 | subquery.Accept(mock.Object); 30 | mock.Verify(x => x.VisitSubquery(subquery)); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /netcore/tests/Koralium.SqlParser.Tests/Koralium.SqlParser.Tests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp3.1 5 | 6 | false 7 | 8 | 9 | 10 | 11 | all 12 | runtime; build; native; contentfiles; analyzers; buildtransitive 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /netcore/tests/Koralium.SqlParser.Tests/OrderByAcceptTests.cs: -------------------------------------------------------------------------------- 1 | using Koralium.SqlParser.OrderBy; 2 | using Koralium.SqlParser.Visitor; 3 | using Moq; 4 | using NUnit.Framework; 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Text; 8 | 9 | namespace Koralium.SqlParser.Tests 10 | { 11 | public class OrderByAcceptTests 12 | { 13 | [Test] 14 | public void TestOrderBySubqueryAccept() 15 | { 16 | Mock mock = new Mock(); 17 | OrderBySubquery orderBySubquery = new OrderBySubquery(); 18 | 19 | orderBySubquery.Accept(mock.Object); 20 | mock.Verify(x => x.VisitOrderBySubquery(orderBySubquery)); 21 | } 22 | 23 | [Test] 24 | public void TestOrderExpressionAccept() 25 | { 26 | Mock mock = new Mock(); 27 | OrderExpression orderExpression = new OrderExpression(); 28 | 29 | orderExpression.Accept(mock.Object); 30 | mock.Verify(x => x.VisitOrderExpression(orderExpression)); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /netcore/tests/Koralium.SqlParser.Tests/TestClass.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | 15 | using System.Collections.Generic; 16 | 17 | namespace Koralium.SqlParser.Tests 18 | { 19 | public class TestClass 20 | { 21 | public string String { get; set; } 22 | 23 | public long Long { get; set; } 24 | 25 | public List IntList { get; set; } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /netcore/tests/Koralium.SqlToExpression.Benchmark/Koralium.SqlToExpression.Benchmark.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | netcoreapp3.1 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /netcore/tests/Koralium.SqlToExpression.Benchmark/Project.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | namespace Koralium.SqlToExpression 15 | { 16 | public class Project 17 | { 18 | public int Id { get; set; } 19 | public string Name { get; set; } 20 | 21 | public Project Other { get; set; } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /netcore/tests/Koralium.SqlToExpression.Benchmark/Visitor.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | using Microsoft.SqlServer.TransactSql.ScriptDom; 15 | 16 | namespace Koralium.SqlToExpression.Benchmark 17 | { 18 | public class Visitor : TSqlFragmentVisitor 19 | { 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /netcore/tests/Koralium.SqlToExpression.Tests/Data/region.csv: -------------------------------------------------------------------------------- 1 | regionkey,name,comment 2 | 0,AFRICA,lar deposits. blithely final packages cajole. regular waters are final requests. regular accounts are according to 3 | 1,AMERICA,"hs use ironic, even requests. s" 4 | 2,ASIA,ges. thinly even pinto beans ca 5 | 3,EUROPE,ly final courts cajole furiously final excuse 6 | 4,MIDDLE EAST,uickly special accounts cajole carefully blithely close requests. carefully final asymptotes haggle furiousl 7 | -------------------------------------------------------------------------------- /netcore/tests/Koralium.SqlToExpression.Tests/Models/EnumTest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace Koralium.SqlToExpression.Tests.Models 6 | { 7 | public enum Enum 8 | { 9 | testval = 0 10 | } 11 | public class EnumTest 12 | { 13 | public Enum Enum { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /netcore/tests/Koralium.SqlToExpression.Tests/Models/NullTest.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | namespace Koralium.SqlToExpression.Tests.Models 15 | { 16 | public class NullTest 17 | { 18 | public string IsNull { get; set; } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /netcore/tests/Koralium.SqlToExpression.Tests/Models/ObjectTest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace Koralium.SqlToExpression.Tests.Models 6 | { 7 | public class InnerObject 8 | { 9 | public string Name { get; set; } 10 | } 11 | public class ObjectTest 12 | { 13 | public InnerObject InnerObject { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /netcore/tests/Koralium.SqlToExpression.Tests/Models/tpch/Nation.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | namespace Koralium.SqlToExpression.Tests.tpch 15 | { 16 | public class Nation 17 | { 18 | public long Nationkey { get; set; } 19 | 20 | public string Name { get; set; } 21 | 22 | public long Regionkey { get; set; } 23 | 24 | public string Comment { get; set; } 25 | 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /netcore/tests/Koralium.SqlToExpression.Tests/Models/tpch/Partsupp.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | namespace Koralium.SqlToExpression.Tests.tpch 15 | { 16 | public class Partsupp 17 | { 18 | public long Partkey { get; set; } 19 | 20 | public long Suppkey { get; set; } 21 | 22 | public int Availqty { get; set; } 23 | 24 | public double Supplycost { get; set; } 25 | 26 | public string Comment { get; set; } 27 | 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /netcore/tests/Koralium.SqlToExpression.Tests/Models/tpch/Region.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | namespace Koralium.SqlToExpression.Tests.tpch 15 | { 16 | public class Region 17 | { 18 | public long Regionkey { get; set; } 19 | 20 | public string Name { get; set; } 21 | 22 | public string Comment { get; set; } 23 | 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /netcore/tests/Koralium.SqlToExpression.Tests/Models/tpch/Supplier.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | namespace Koralium.SqlToExpression.Tests.tpch 15 | { 16 | public class Supplier 17 | { 18 | public long Suppkey { get; set; } 19 | 20 | public string Name { get; set; } 21 | 22 | public string Address { get; set; } 23 | 24 | public long Nationkey { get; set; } 25 | 26 | public string Phone { get; set; } 27 | 28 | public double Acctbal { get; set; } 29 | 30 | public string Comment { get; set; } 31 | 32 | 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /netcore/tests/Koralium.TestFramework.Tests/testappsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "TestDataLocation": "../../../../../../TestData" 3 | } 4 | -------------------------------------------------------------------------------- /netcore/tests/Koralium.Transport.ArrowFlight.Tests/Koralium.Transport.ArrowFlight.Tests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp3.1 5 | 6 | false 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | PreserveNewest 16 | true 17 | PreserveNewest 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /netcore/tests/Koralium.Transport.ArrowFlight.Tests/testappsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "TestDataLocation": "../../../../../../TestData" 3 | } 4 | -------------------------------------------------------------------------------- /netcore/tests/Koralium.Transport.Benchmarks/Koralium.Transport.Benchmarks.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | netcoreapp3.1 6 | 7 | 8 | 9 | false 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | PreserveNewest 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /netcore/tests/Koralium.Transport.Benchmarks/Program.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | using BenchmarkDotNet.Running; 15 | 16 | namespace Koralium.Transport.Benchmarks 17 | { 18 | static class Program 19 | { 20 | static void Main(string[] args) 21 | { 22 | var webFactory = new TestWebFactory(); 23 | var summary = BenchmarkSwitcher.FromAssembly(typeof(Program).Assembly).Run(args); 24 | webFactory.Stop(); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /netcore/tests/Koralium.Transport.Benchmarks/testappsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Koralium": "Warning", 5 | "Default": "Warning", 6 | "Microsoft": "Warning", 7 | "Microsoft.Hosting.Lifetime": "Warning" 8 | } 9 | }, 10 | "TestDataLocation": "../../../../../../TestData" 11 | } 12 | -------------------------------------------------------------------------------- /netcore/tests/Koralium.Transport.Json.Tests/Koralium.Transport.Json.Tests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp3.1 5 | 6 | false 7 | 8 | 9 | 10 | 11 | all 12 | runtime; build; native; contentfiles; analyzers; buildtransitive 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | PreserveNewest 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /netcore/tests/Koralium.Transport.Json.Tests/testappsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "TestDataLocation": "../../../../../../TestData" 3 | } 4 | -------------------------------------------------------------------------------- /netcore/tests/Koralium.Transport.RowLevelSecurity.Tests/Koralium.Transport.RowLevelSecurity.Tests.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp3.1 5 | 6 | false 7 | 8 | 9 | 10 | 11 | all 12 | runtime; build; native; contentfiles; analyzers; buildtransitive 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | PreserveNewest 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /netcore/tests/Koralium.Transport.RowLevelSecurity.Tests/testappsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "TestDataLocation": "../../../../../../TestData" 3 | } 4 | -------------------------------------------------------------------------------- /netcore/tests/Koralium.WebTests/CustomSearchProvider.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | using Koralium.SqlToExpression; 15 | using Koralium.SqlToExpression.Interfaces; 16 | using System; 17 | using System.Linq.Expressions; 18 | 19 | namespace Koralium.WebTests 20 | { 21 | public class CustomSearchProvider : ISearchExpressionProvider 22 | { 23 | public Expression GetSearchExpression(ISearchParameters searchParameters) 24 | { 25 | 26 | throw new NotImplementedException(); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /netcore/tests/Koralium.WebTests/Entities/Employee.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | namespace Koralium.WebTests.Entities 15 | { 16 | public class Employee 17 | { 18 | public string Name { get; set; } 19 | 20 | public string CompanyId { get; set; } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /netcore/tests/Koralium.WebTests/Entities/Empty.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | namespace Koralium.WebTests.Entities 15 | { 16 | public class Empty 17 | { 18 | public string Id { get; set; } 19 | public string Name { get; set; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /netcore/tests/Koralium.WebTests/Entities/IndexTest.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | 15 | namespace Koralium.WebTests.Entities 16 | { 17 | public class IndexTest 18 | { 19 | public long Key { get; set; } 20 | 21 | public string StringKey { get; set; } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /netcore/tests/Koralium.WebTests/Entities/NoNamingPolicyTest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | 6 | namespace Koralium.WebTests.Entities 7 | { 8 | public class NoPolicyInner 9 | { 10 | public string Name { get; set; } 11 | } 12 | public class NoNamingPolicyTest 13 | { 14 | public NoPolicyInner Object { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /netcore/tests/Koralium.WebTests/Entities/Project.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | using Koralium.WebTests.Entities; 15 | 16 | namespace Koralium.WebTests 17 | { 18 | public class Project 19 | { 20 | public long Id { get; set; } 21 | 22 | public string Name { get; set; } 23 | 24 | public Company Company { get; set; } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /netcore/tests/Koralium.WebTests/Entities/SpecialCharactersTest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | 6 | namespace Koralium.WebTests.Entities 7 | { 8 | public class SpecialCharactersTest 9 | { 10 | public string Name { get; set; } 11 | 12 | public override bool Equals(object obj) 13 | { 14 | if (obj is SpecialCharactersTest c) 15 | { 16 | return Name.Equals(c.Name); 17 | } 18 | return false; 19 | } 20 | 21 | public override int GetHashCode() 22 | { 23 | return Name.GetHashCode(); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /netcore/tests/Koralium.WebTests/Entities/TestTypeEnum.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | 15 | namespace Koralium.WebTests.Entities 16 | { 17 | public enum TestTypeEnum 18 | { 19 | Active = 0, 20 | Inactive = 1 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /netcore/tests/Koralium.WebTests/Entities/TypeTestInnerInnerObject.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | 15 | namespace Koralium.WebTests.Entities 16 | { 17 | public class TypeTestInnerInnerObject 18 | { 19 | public string StringValue { get; set; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /netcore/tests/Koralium.WebTests/Entities/tpch/Nation.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | namespace Koralium.WebTests.Entities.tpch 15 | { 16 | public class Nation 17 | { 18 | public long Nationkey { get; set; } 19 | 20 | public string Name { get; set; } 21 | 22 | public long Regionkey { get; set; } 23 | 24 | public string Comment { get; set; } 25 | 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /netcore/tests/Koralium.WebTests/Entities/tpch/Partsupp.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | namespace Koralium.WebTests.Entities.tpch 15 | { 16 | public class Partsupp 17 | { 18 | public long Partkey { get; set; } 19 | 20 | public long Suppkey { get; set; } 21 | 22 | public int Availqty { get; set; } 23 | 24 | public double Supplycost { get; set; } 25 | 26 | public string Comment { get; set; } 27 | 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /netcore/tests/Koralium.WebTests/Entities/tpch/Region.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | namespace Koralium.WebTests.Entities.tpch 15 | { 16 | public class Region 17 | { 18 | public long Regionkey { get; set; } 19 | 20 | public string Name { get; set; } 21 | 22 | public string Comment { get; set; } 23 | 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /netcore/tests/Koralium.WebTests/Entities/tpch/Supplier.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | namespace Koralium.WebTests.Entities.tpch 15 | { 16 | public class Supplier 17 | { 18 | public long Suppkey { get; set; } 19 | 20 | public string Name { get; set; } 21 | 22 | public string Address { get; set; } 23 | 24 | public long Nationkey { get; set; } 25 | 26 | public string Phone { get; set; } 27 | 28 | public double Acctbal { get; set; } 29 | 30 | public string Comment { get; set; } 31 | 32 | 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /netcore/tests/Koralium.WebTests/Koralium.WebTests.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp3.1 5 | Linux 6 | ..\.. 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /netcore/tests/Koralium.WebTests/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:60695", 7 | "sslPort": 0 8 | } 9 | }, 10 | "$schema": "http://json.schemastore.org/launchsettings.json", 11 | "profiles": { 12 | "IIS Express": { 13 | "commandName": "IISExpress", 14 | "launchBrowser": true, 15 | "launchUrl": "weatherforecast", 16 | "environmentVariables": { 17 | "ASPNETCORE_ENVIRONMENT": "Development" 18 | } 19 | }, 20 | "Koralium.WebTests": { 21 | "commandName": "Project", 22 | "launchBrowser": true, 23 | "launchUrl": "weatherforecast", 24 | "environmentVariables": { 25 | "ASPNETCORE_ENVIRONMENT": "Development" 26 | }, 27 | "applicationUrl": "http://localhost:5000" 28 | }, 29 | "Docker": { 30 | "commandName": "Docker", 31 | "launchBrowser": true, 32 | "launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}/weatherforecast", 33 | "publishAllPorts": true 34 | } 35 | } 36 | } -------------------------------------------------------------------------------- /netcore/tests/Koralium.WebTests/Resolvers/CompanyResolver.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | using Koralium.WebTests.Entities; 15 | using System.Linq; 16 | using System.Threading.Tasks; 17 | 18 | namespace Koralium.WebTests.Resolvers 19 | { 20 | public class CompanyResolver : TableResolver 21 | { 22 | protected override Task> GetQueryableData(IQueryOptions queryOptions, ICustomMetadata customMetadata) 23 | { 24 | return Task.FromResult(TestData.GetCompanies()); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /netcore/tests/Koralium.WebTests/Resolvers/EmptyResolver.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | using Koralium.WebTests.Entities; 15 | using System.Collections.Generic; 16 | using System.Linq; 17 | using System.Threading.Tasks; 18 | 19 | namespace Koralium.WebTests.Resolvers 20 | { 21 | public class EmptyResolver : TableResolver 22 | { 23 | protected override async Task> GetQueryableData(IQueryOptions queryOptions, ICustomMetadata customMetadata) 24 | { 25 | return new List().AsQueryable(); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /netcore/tests/Koralium.WebTests/Resolvers/NoNamingPolicyResolver.cs: -------------------------------------------------------------------------------- 1 | using Koralium.WebTests.Entities; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | 7 | namespace Koralium.WebTests.Resolvers 8 | { 9 | public class NoNamingPolicyResolver : TableResolver 10 | { 11 | protected override Task> GetQueryableData(IQueryOptions queryOptions, ICustomMetadata customMetadata) 12 | { 13 | var data = new List() 14 | { 15 | new NoNamingPolicyTest() 16 | { 17 | Object = new NoPolicyInner() 18 | { 19 | Name = "test" 20 | } 21 | } 22 | }; 23 | return Task.FromResult(data.AsQueryable()); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /netcore/tests/Koralium.WebTests/Resolvers/SpecialCharacterResolver.cs: -------------------------------------------------------------------------------- 1 | using Koralium.WebTests.Entities; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | 7 | namespace Koralium.WebTests.Resolvers 8 | { 9 | public class SpecialCharacterResolver : TableResolver 10 | { 11 | protected override Task> GetQueryableData(IQueryOptions queryOptions, ICustomMetadata customMetadata) 12 | { 13 | return Task.FromResult(TestData.GetSpecialCharactersTests()); 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /netcore/tests/Koralium.WebTests/Resolvers/TestResolver.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | using Koralium.WebTests.Entities; 15 | using System.Linq; 16 | using System.Threading.Tasks; 17 | 18 | namespace Koralium.WebTests.Resolvers 19 | { 20 | public class TestResolver : TableResolver 21 | { 22 | protected override Task> GetQueryableData(IQueryOptions queryOptions, ICustomMetadata customMetadata) 23 | { 24 | return Task.FromResult(TestData.GetData()); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /netcore/tests/Koralium.WebTests/Resolvers/TypeTestResolver.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | using Koralium.WebTests.Entities; 15 | using System.Linq; 16 | using System.Threading.Tasks; 17 | 18 | namespace Koralium.WebTests.Resolvers 19 | { 20 | public class TypeTestResolver : TableResolver 21 | { 22 | protected override Task> GetQueryableData(IQueryOptions queryOptions, ICustomMetadata customMetadata) 23 | { 24 | return Task.FromResult(TestData.GetTypeTests()); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /netcore/tests/Koralium.WebTests/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Koralium": "Trace", 5 | "Default": "Information", 6 | "Microsoft": "Information", 7 | "Microsoft.Hosting.Lifetime": "Information" 8 | } 9 | }, 10 | "TestDataLocation": "../../../TestData" 11 | } 12 | -------------------------------------------------------------------------------- /netcore/tests/Koralium.WebTests/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | }, 9 | "AllowedHosts": "*", 10 | "TestDataLocation": "./Data" 11 | } 12 | -------------------------------------------------------------------------------- /presto/presto-connector-arrowflight/.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | 3 | *.java text eol=lf -------------------------------------------------------------------------------- /presto/presto-connector-arrowflight/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | *.ipr 3 | *.iws 4 | target/ 5 | /var 6 | /*/var/ 7 | /presto-product-tests/**/var/ 8 | pom.xml.versionsBackup 9 | test-output/ 10 | test-reports/ 11 | /atlassian-ide-plugin.xml 12 | .idea 13 | .DS_Store 14 | .classpath 15 | .settings 16 | .project 17 | temp-testng-customsuite.xml 18 | test-output 19 | .externalToolBuilders 20 | *~ 21 | benchmark_outputs 22 | *.pyc 23 | *.class 24 | .checkstyle 25 | .mvn/timing.properties 26 | node_modules 27 | tmpData -------------------------------------------------------------------------------- /presto/presto-connector-arrowflight/README.md: -------------------------------------------------------------------------------- 1 | # How to build 2 | 3 | To build the presto connector, write the following command: 4 | 5 | ``` 6 | mvn package 7 | ``` 8 | 9 | # Use in IntelliJ 10 | 11 | To code in IntelliJ you first have to run the build command 12 | 13 | ``` 14 | mvn package -DskipTests 15 | ``` 16 | 17 | This will generate the gRPC code from the proto file. -------------------------------------------------------------------------------- /presto/presto-connector-arrowflight/convert.ps1: -------------------------------------------------------------------------------- 1 | Get-ChildItem "." -recurse -Filter *.java | 2 | Foreach-Object { 3 | 4 | Write-Output $_.FullName 5 | 6 | ((Get-Content $_.FullName) -join "`n") + "`n" | Set-Content -NoNewline $_.FullName 7 | } -------------------------------------------------------------------------------- /presto/presto-connector-arrowflight/src/main/java/io/prestosql/plugin/koralium/KoraliumTransactionHandle.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | package io.prestosql.plugin.koralium; 15 | 16 | import io.prestosql.spi.connector.ConnectorTransactionHandle; 17 | 18 | public enum KoraliumTransactionHandle 19 | implements ConnectorTransactionHandle 20 | { 21 | INSTANCE 22 | } 23 | -------------------------------------------------------------------------------- /presto/presto-connector-arrowflight/src/main/java/io/prestosql/plugin/koralium/cache/DisabledCacheSplitManager.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | package io.prestosql.plugin.koralium.cache; 15 | 16 | import io.prestosql.spi.HostAddress; 17 | 18 | public class DisabledCacheSplitManager 19 | implements QueryCacheSplitManager 20 | { 21 | @Override 22 | public HostAddress getCacheNode(String query) 23 | { 24 | return null; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /presto/presto-connector-arrowflight/src/main/java/io/prestosql/plugin/koralium/cache/QueryCache.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | package io.prestosql.plugin.koralium.cache; 15 | 16 | public interface QueryCache 17 | { 18 | boolean containsQuery(String query); 19 | 20 | //Get a new entry for the cache, this is not yet added to the cache 21 | QueryCacheEntry newEntry(String query); 22 | 23 | QueryCacheEntry get(String query); 24 | 25 | void add(QueryCacheEntry entry); 26 | } 27 | -------------------------------------------------------------------------------- /presto/presto-connector-arrowflight/src/main/java/io/prestosql/plugin/koralium/cache/QueryCacheSplitManager.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | package io.prestosql.plugin.koralium.cache; 15 | 16 | import io.prestosql.spi.HostAddress; 17 | 18 | //Used by the split manager to check if any node has a query (split) in its memory cache 19 | public interface QueryCacheSplitManager 20 | { 21 | HostAddress getCacheNode(String query); 22 | } 23 | -------------------------------------------------------------------------------- /presto/presto-connector-arrowflight/src/test/java/io/prestosql/plugin/koralium/TestingKoraliumConnectorFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | package io.prestosql.plugin.koralium; 15 | 16 | public class TestingKoraliumConnectorFactory 17 | extends KoraliumConnectorFactory 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /presto/presto-connector-arrowflight/src/test/resources/example-data/numbers-1.csv: -------------------------------------------------------------------------------- 1 | one, 1 2 | two, 2 3 | three, 3 4 | -------------------------------------------------------------------------------- /presto/presto-connector-arrowflight/src/test/resources/example-data/numbers-2.csv: -------------------------------------------------------------------------------- 1 | ten, 10 2 | eleven, 11 3 | twelve, 12 4 | -------------------------------------------------------------------------------- /presto/presto-connector-legacy/.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | 3 | *.java text eol=lf -------------------------------------------------------------------------------- /presto/presto-connector-legacy/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | *.ipr 3 | *.iws 4 | target/ 5 | /var 6 | /*/var/ 7 | /presto-product-tests/**/var/ 8 | pom.xml.versionsBackup 9 | test-output/ 10 | test-reports/ 11 | /atlassian-ide-plugin.xml 12 | .idea 13 | .DS_Store 14 | .classpath 15 | .settings 16 | .project 17 | temp-testng-customsuite.xml 18 | test-output 19 | .externalToolBuilders 20 | *~ 21 | benchmark_outputs 22 | *.pyc 23 | *.class 24 | .checkstyle 25 | .mvn/timing.properties 26 | node_modules 27 | tmpData -------------------------------------------------------------------------------- /presto/presto-connector-legacy/README.md: -------------------------------------------------------------------------------- 1 | # How to build 2 | 3 | To build the presto connector, write the following command: 4 | 5 | ``` 6 | mvn package 7 | ``` 8 | 9 | # Use in IntelliJ 10 | 11 | To code in IntelliJ you first have to run the build command 12 | 13 | ``` 14 | mvn package -DskipTests 15 | ``` 16 | 17 | This will generate the gRPC code from the proto file. -------------------------------------------------------------------------------- /presto/presto-connector-legacy/convert.ps1: -------------------------------------------------------------------------------- 1 | Get-ChildItem "." -recurse -Filter *.java | 2 | Foreach-Object { 3 | 4 | Write-Output $_.FullName 5 | 6 | ((Get-Content $_.FullName) -join "`n") + "`n" | Set-Content -NoNewline $_.FullName 7 | } -------------------------------------------------------------------------------- /presto/presto-connector-legacy/src/main/java/io/prestosql/plugin/koralium/KoraliumTransactionHandle.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | package io.prestosql.plugin.koralium; 15 | 16 | import io.prestosql.spi.connector.ConnectorTransactionHandle; 17 | 18 | public enum KoraliumTransactionHandle 19 | implements ConnectorTransactionHandle 20 | { 21 | INSTANCE 22 | } 23 | -------------------------------------------------------------------------------- /presto/presto-connector-legacy/src/main/java/io/prestosql/plugin/koralium/encoders/IEncoder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | package io.prestosql.plugin.koralium.encoders; 15 | 16 | import io.prestosql.plugin.koralium.Presto; 17 | import io.prestosql.spi.connector.RecordCursor; 18 | 19 | public interface IEncoder 20 | { 21 | IEncoder create(int columnId); 22 | 23 | void encode(int rowIndex, RecordCursor cursor, int index); 24 | 25 | void addBlock(Presto.Columns.Builder blockBatchBuilder, Presto.Page.Builder pageBuilder); 26 | 27 | String toFilter(Object object); 28 | } 29 | -------------------------------------------------------------------------------- /presto/presto-connector-legacy/src/test/java/io/prestosql/plugin/koralium/TestingKoraliumConnectorFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | package io.prestosql.plugin.koralium; 15 | 16 | public class TestingKoraliumConnectorFactory 17 | extends KoraliumConnectorFactory 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /presto/presto-connector-legacy/src/test/resources/example-data/numbers-1.csv: -------------------------------------------------------------------------------- 1 | one, 1 2 | two, 2 3 | three, 3 4 | -------------------------------------------------------------------------------- /presto/presto-connector-legacy/src/test/resources/example-data/numbers-2.csv: -------------------------------------------------------------------------------- 1 | ten, 10 2 | eleven, 11 3 | twelve, 12 4 | -------------------------------------------------------------------------------- /presto/trino-connector-arrowflight/.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | 3 | *.java text eol=lf -------------------------------------------------------------------------------- /presto/trino-connector-arrowflight/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | *.ipr 3 | *.iws 4 | target/ 5 | /var 6 | /*/var/ 7 | /presto-product-tests/**/var/ 8 | pom.xml.versionsBackup 9 | test-output/ 10 | test-reports/ 11 | /atlassian-ide-plugin.xml 12 | .idea 13 | .DS_Store 14 | .classpath 15 | .settings 16 | .project 17 | temp-testng-customsuite.xml 18 | test-output 19 | .externalToolBuilders 20 | *~ 21 | benchmark_outputs 22 | *.pyc 23 | *.class 24 | .checkstyle 25 | .mvn/timing.properties 26 | node_modules 27 | tmpData -------------------------------------------------------------------------------- /presto/trino-connector-arrowflight/README.md: -------------------------------------------------------------------------------- 1 | # How to build 2 | 3 | To build the presto connector, write the following command: 4 | 5 | ``` 6 | mvn package 7 | ``` 8 | 9 | # Use in IntelliJ 10 | 11 | To code in IntelliJ you first have to run the build command 12 | 13 | ``` 14 | mvn package -DskipTests 15 | ``` 16 | 17 | This will generate the gRPC code from the proto file. -------------------------------------------------------------------------------- /presto/trino-connector-arrowflight/convert.ps1: -------------------------------------------------------------------------------- 1 | Get-ChildItem "." -recurse -Filter *.java | 2 | Foreach-Object { 3 | 4 | Write-Output $_.FullName 5 | 6 | ((Get-Content $_.FullName) -join "`n") + "`n" | Set-Content -NoNewline $_.FullName 7 | } -------------------------------------------------------------------------------- /presto/trino-connector-arrowflight/src/main/java/io/trino/plugin/koralium/KoraliumTransactionHandle.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | package io.trino.plugin.koralium; 15 | 16 | import io.trino.spi.connector.ConnectorTransactionHandle; 17 | 18 | public enum KoraliumTransactionHandle 19 | implements ConnectorTransactionHandle 20 | { 21 | INSTANCE 22 | } 23 | -------------------------------------------------------------------------------- /presto/trino-connector-arrowflight/src/main/java/io/trino/plugin/koralium/cache/DisabledCacheSplitManager.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | package io.trino.plugin.koralium.cache; 15 | 16 | import io.trino.spi.HostAddress; 17 | 18 | public class DisabledCacheSplitManager 19 | implements QueryCacheSplitManager 20 | { 21 | @Override 22 | public HostAddress getCacheNode(String query) 23 | { 24 | return null; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /presto/trino-connector-arrowflight/src/main/java/io/trino/plugin/koralium/cache/QueryCache.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | package io.trino.plugin.koralium.cache; 15 | 16 | public interface QueryCache 17 | { 18 | boolean containsQuery(String query); 19 | 20 | //Get a new entry for the cache, this is not yet added to the cache 21 | QueryCacheEntry newEntry(String query); 22 | 23 | QueryCacheEntry get(String query); 24 | 25 | void add(QueryCacheEntry entry); 26 | } 27 | -------------------------------------------------------------------------------- /presto/trino-connector-arrowflight/src/main/java/io/trino/plugin/koralium/cache/QueryCacheSplitManager.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | package io.trino.plugin.koralium.cache; 15 | 16 | import io.trino.spi.HostAddress; 17 | 18 | //Used by the split manager to check if any node has a query (split) in its memory cache 19 | public interface QueryCacheSplitManager 20 | { 21 | HostAddress getCacheNode(String query); 22 | } 23 | -------------------------------------------------------------------------------- /presto/trino-connector-arrowflight/src/test/java/io/trino/plugin/koralium/TestingKoraliumConnectorFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | package io.trino.plugin.koralium; 15 | 16 | public class TestingKoraliumConnectorFactory 17 | extends KoraliumConnectorFactory 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /presto/trino-connector-arrowflight/src/test/resources/example-data/numbers-1.csv: -------------------------------------------------------------------------------- 1 | one, 1 2 | two, 2 3 | three, 3 4 | -------------------------------------------------------------------------------- /presto/trino-connector-arrowflight/src/test/resources/example-data/numbers-2.csv: -------------------------------------------------------------------------------- 1 | ten, 10 2 | eleven, 11 3 | twelve, 12 4 | -------------------------------------------------------------------------------- /pretest.ps1: -------------------------------------------------------------------------------- 1 | docker build -f netcore/tests/Koralium.WebTests/Dockerfile -t koraliumwebtest . -------------------------------------------------------------------------------- /typescript-client/arrow/generate_proto_files.ps1: -------------------------------------------------------------------------------- 1 | cd protos 2 | protoc-gen-grpc --plugin=protoc-gen-ts=..\node_modules\.bin\protoc-gen-ts.cmd --js_out="import_style=commonjs,binary:../src/generated" --ts_out="service=grpc-node:../src/generated" --grpc_out="../src/generated" Flight.proto 3 | cd .. -------------------------------------------------------------------------------- /typescript-client/arrow/jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | preset: 'ts-jest', 3 | testEnvironment: 'node', 4 | testResultsProcessor: 'jest-sonar-reporter', 5 | coveragePathIgnorePatterns: [ 6 | "/node_modules/", 7 | "/test/", 8 | "/generated/" 9 | ], 10 | testPathIgnorePatterns: ["lib"] 11 | }; -------------------------------------------------------------------------------- /typescript-client/arrow/src/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | export * from './koraliumarrowclient' -------------------------------------------------------------------------------- /typescript-client/arrow/src/internal/KoraliumRow.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | import { DataType } from "apache-arrow"; 15 | import { RowLike } from "apache-arrow/type"; 16 | 17 | export class KoraliumRow { 18 | constructor(row: RowLike, proxyHandler: ProxyHandler) { 19 | return new Proxy(row, proxyHandler as any) 20 | } 21 | } -------------------------------------------------------------------------------- /typescript-client/arrow/src/internal/arrow/utils/MessageReader.ts: -------------------------------------------------------------------------------- 1 | import { Message } from 'apache-arrow' 2 | 3 | 4 | export function decodeMessage(buf: any) { 5 | return Message.decode(buf) 6 | } -------------------------------------------------------------------------------- /typescript-client/arrow/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "target": "esnext", 5 | "moduleResolution": "node", 6 | "baseUrl": "./", 7 | "paths": { 8 | "*" : ["./node_modules/@types/*", "src/*"] 9 | }, 10 | "lib": ["dom", "esnext", "esnext.asynciterable"], 11 | "sourceMap": true, 12 | "outDir": "lib", 13 | "esModuleInterop": true, 14 | "allowJs": true, 15 | "declaration": true, 16 | "strict": false, 17 | "noImplicitAny": false, 18 | "strictNullChecks": false, 19 | "skipLibCheck": true 20 | }, 21 | "exclude": [ 22 | "node_modules", 23 | "tests", 24 | "lib", 25 | "jest.config.*" 26 | ] 27 | } -------------------------------------------------------------------------------- /typescript-client/base-client/jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | preset: 'ts-jest', 3 | testEnvironment: 'node', 4 | testResultsProcessor: 'jest-sonar-reporter', 5 | coveragePathIgnorePatterns: [ 6 | "/node_modules/", 7 | "/test/", 8 | "/generated/" 9 | ], 10 | testPathIgnorePatterns: ["lib"] 11 | }; -------------------------------------------------------------------------------- /typescript-client/base-client/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@koralium/base-client", 3 | "version": "1.0.5", 4 | "main": "./lib/index.js", 5 | "license": "MIT", 6 | "scripts": { 7 | "build": "tsc --build", 8 | "clean": "tsc --build --clean", 9 | "test": "jest", 10 | "coverage": "jest --coverage", 11 | "publish-package": "npm publish --access public" 12 | }, 13 | "devDependencies": { 14 | "@types/chai": "^4.2.11", 15 | "@types/google-protobuf": "^3.7.2", 16 | "@types/jest": "^26.0.24", 17 | "@types/node": "^14.0.14", 18 | "chai": "4.2.0", 19 | "chai-arrays": "^2.2.0", 20 | "cross-env": "5.2.0", 21 | "jest": "^26.1.0", 22 | "jest-editor-support": "^27.2.0", 23 | "jest-sonar-reporter": "^2.0.0", 24 | "neat-csv": "^5.2.0", 25 | "nyc": "14.1.1", 26 | "testcontainers": "^2.14.0", 27 | "ts-jest": "^26.1.1", 28 | "ts-node": "^8.10.2", 29 | "typescript": "^3.2.2" 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /typescript-client/base-client/src/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | export * from "./queryBuilder" 15 | export * from "./objectToSelectMapper" 16 | export * from "./queryOptions" 17 | export * from "./queryResult" 18 | export * from "./koraliumClient" -------------------------------------------------------------------------------- /typescript-client/base-client/src/koraliumClient.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | import { QueryOptions, QueryResult } from "."; 15 | 16 | export interface KoraliumClient { 17 | queryScalar(sql: string, queryOptions?: QueryOptions): Promise 18 | query(sql: string, queryOptions?: QueryOptions): Promise; 19 | } -------------------------------------------------------------------------------- /typescript-client/base-client/src/queryOptions.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | export interface QueryOptions { 15 | parameters?: {} | null; 16 | headers?: {}; 17 | extraData?: {}; 18 | } -------------------------------------------------------------------------------- /typescript-client/base-client/src/queryResult.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | export class Metadata { 15 | customMetadata: {}; 16 | 17 | constructor(customMetadata: {}) { 18 | this.customMetadata = customMetadata; 19 | } 20 | } 21 | 22 | export class QueryResult { 23 | rows: Array; 24 | metadata: Metadata; 25 | 26 | constructor(rows: Array, metadata: Metadata) { 27 | this.rows = rows; 28 | this.metadata = metadata; 29 | } 30 | } -------------------------------------------------------------------------------- /typescript-client/base-client/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "target": "es6", 5 | "lib": ["es6"], 6 | "sourceMap": true, 7 | "outDir": "lib", 8 | "esModuleInterop": true, 9 | "allowJs": true, 10 | "declaration": true, 11 | "strict": true, 12 | "noImplicitAny": true, 13 | "strictNullChecks": true 14 | }, 15 | "exclude": [ 16 | "node_modules", 17 | "tests", 18 | "lib", 19 | "jest.config.*" 20 | ] 21 | } 22 | -------------------------------------------------------------------------------- /typescript-client/json/jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | preset: 'ts-jest', 3 | testEnvironment: 'node', 4 | testResultsProcessor: 'jest-sonar-reporter', 5 | coveragePathIgnorePatterns: [ 6 | "/node_modules/", 7 | "/test/", 8 | "/generated/" 9 | ], 10 | testPathIgnorePatterns: ["lib"] 11 | }; -------------------------------------------------------------------------------- /typescript-client/json/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@koralium/koralium-json", 3 | "version": "1.0.5", 4 | "main": "./lib/index.js", 5 | "license": "MIT", 6 | "scripts": { 7 | "build": "tsc --build", 8 | "clean": "tsc --build --clean", 9 | "test": "jest", 10 | "coverage": "jest --coverage", 11 | "publish-package": "npm publish --access public" 12 | }, 13 | "devDependencies": { 14 | "@types/chai": "^4.2.11", 15 | "@types/google-protobuf": "^3.7.2", 16 | "@types/jest": "^26.0.3", 17 | "@types/node": "^14.0.14", 18 | "chai": "4.2.0", 19 | "chai-arrays": "^2.2.0", 20 | "cross-env": "5.2.0", 21 | "jest": "^26.1.0", 22 | "jest-editor-support": "^27.2.0", 23 | "jest-sonar-reporter": "^2.0.0", 24 | "neat-csv": "^5.2.0", 25 | "nyc": "14.1.1", 26 | "testcontainers": "^2.14.0", 27 | "ts-jest": "^26.1.1", 28 | "ts-node": "^8.10.2", 29 | "typescript": "^3.2.2", 30 | "apollo-server": "^3.3.0", 31 | "graphql": "^15.5.3" 32 | }, 33 | "dependencies": { 34 | "axios": "^0.21.1", 35 | "@koralium/base-client": "^1.0.5" 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /typescript-client/json/src/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | export * from "./client" -------------------------------------------------------------------------------- /typescript-client/json/test-report.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /typescript-client/json/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "target": "es6", 5 | "lib": ["es6"], 6 | "sourceMap": true, 7 | "outDir": "lib", 8 | "esModuleInterop": true, 9 | "allowJs": true, 10 | "declaration": true, 11 | "strict": true, 12 | "noImplicitAny": true, 13 | "strictNullChecks": true 14 | }, 15 | "exclude": [ 16 | "node_modules", 17 | "tests", 18 | "lib", 19 | "jest.config.*" 20 | ] 21 | } 22 | -------------------------------------------------------------------------------- /typescript-client/legacy/generate_proto_files.ps1: -------------------------------------------------------------------------------- 1 | cd protos 2 | protoc-gen-grpc --plugin=protoc-gen-ts=..\node_modules\.bin\protoc-gen-ts.cmd --js_out="import_style=commonjs,binary:../src/generated" --ts_out="service=grpc-node:../src/generated" --grpc_out="../src/generated" koralium.proto 3 | cd .. -------------------------------------------------------------------------------- /typescript-client/legacy/jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | preset: 'ts-jest', 3 | testEnvironment: 'node', 4 | testResultsProcessor: 'jest-sonar-reporter', 5 | coveragePathIgnorePatterns: [ 6 | "/node_modules/", 7 | "/test/", 8 | "/generated/" 9 | ], 10 | testPathIgnorePatterns: ["lib"] 11 | }; -------------------------------------------------------------------------------- /typescript-client/legacy/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@koralium/koraliumclient", 3 | "version": "1.0.5", 4 | "main": "./lib/index.js", 5 | "license": "MIT", 6 | "scripts": { 7 | "build": "tsc --build", 8 | "clean": "tsc --build --clean", 9 | "test": "jest", 10 | "coverage": "jest --coverage", 11 | "publish-package": "npm publish --access public" 12 | }, 13 | "devDependencies": { 14 | "@types/chai": "^4.2.11", 15 | "@types/google-protobuf": "^3.7.2", 16 | "@types/jest": "^26.0.3", 17 | "@types/node": "^14.0.14", 18 | "chai": "4.2.0", 19 | "chai-arrays": "^2.2.0", 20 | "cross-env": "5.2.0", 21 | "jest": "^26.1.0", 22 | "jest-editor-support": "^27.2.0", 23 | "jest-sonar-reporter": "^2.0.0", 24 | "neat-csv": "^5.2.0", 25 | "nyc": "14.1.1", 26 | "testcontainers": "^2.14.0", 27 | "ts-jest": "^26.1.1", 28 | "ts-node": "^8.10.2", 29 | "ts-protoc-gen": "^0.12.0", 30 | "typescript": "^3.2.2" 31 | }, 32 | "dependencies": { 33 | "grpc": "^1.24.3", 34 | "grpc-tools": "^1.9.0" 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /typescript-client/legacy/src/decoders/decoder.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | import { Page, Block } from "../generated/koralium_pb"; 15 | 16 | export interface IDecoder { 17 | 18 | newPage(page: Page): void; 19 | 20 | getFieldName(): string; 21 | 22 | baseValue(): any; 23 | 24 | decode(block: Block, objects: any[], startIndex: number, numberOfElements?: number): number; 25 | 26 | decodeArray(block: Block, array: any[], startIndex: number, numberOfElements?: number): number; 27 | } -------------------------------------------------------------------------------- /typescript-client/legacy/src/encoders/parameterEncoder.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | import { KeyValue } from "../generated/koralium_pb"; 15 | import encodeScalar from "./scalarEncoder"; 16 | 17 | export default function encodeParameters(parameters: {[key: string]: any;}) { 18 | 19 | const output: Array = []; 20 | 21 | for (let [key] of Object.entries(parameters)) { 22 | const parameter = new KeyValue(); 23 | parameter.setName(key); 24 | parameter.setValue(encodeScalar(parameters[key])); 25 | output.push(parameter); 26 | } 27 | 28 | return output; 29 | } -------------------------------------------------------------------------------- /typescript-client/legacy/src/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | export * from "./client" 15 | export * from "./queryBuilder" 16 | export * from "./objectToSelectMapper" 17 | export * from "./queryOptions" 18 | export * from "./queryResult" -------------------------------------------------------------------------------- /typescript-client/legacy/src/queryOptions.ts: -------------------------------------------------------------------------------- 1 | export interface QueryOptions { 2 | parameters?: {} | null; 3 | headers?: {}; 4 | extraData?: {}; 5 | } -------------------------------------------------------------------------------- /typescript-client/legacy/src/queryResult.ts: -------------------------------------------------------------------------------- 1 | 2 | export class Metadata { 3 | customMetadata: {}; 4 | 5 | constructor(customMetadata: {}) { 6 | this.customMetadata = customMetadata; 7 | } 8 | } 9 | 10 | export class QueryResult { 11 | rows: Array<{}>; 12 | metadata: Metadata; 13 | 14 | constructor(rows: Array<{}>, metadata: Metadata) { 15 | this.rows = rows; 16 | this.metadata = metadata; 17 | } 18 | } -------------------------------------------------------------------------------- /typescript-client/legacy/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "target": "es6", 5 | "lib": ["es6"], 6 | "sourceMap": true, 7 | "outDir": "lib", 8 | "esModuleInterop": true, 9 | "allowJs": true, 10 | "declaration": true, 11 | "strict": true, 12 | "noImplicitAny": true, 13 | "strictNullChecks": true 14 | }, 15 | "exclude": [ 16 | "node_modules", 17 | "tests", 18 | "lib", 19 | "jest.config.*" 20 | ] 21 | } 22 | -------------------------------------------------------------------------------- /typescript-client/lerna.json: -------------------------------------------------------------------------------- 1 | { 2 | "packages": [ 3 | "*" 4 | ], 5 | "version": "1.3.0", 6 | "publishConfig": { 7 | "access": "public" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /typescript-client/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "root", 3 | "private": false, 4 | "devDependencies": { 5 | "lerna": "^4.0.0" 6 | }, 7 | "scripts": { 8 | "bootstrap": "lerna bootstrap", 9 | "lerna": "lerna", 10 | "set-version": "lerna version --no-git-tag-version --no-push --yes", 11 | "build": "lerna run build", 12 | "publish-packages": "lerna publish --no-git-tag-version --no-push --yes", 13 | "test": "lerna run test" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /typescript-client/rowlevelsecurity/generate_proto_files.ps1: -------------------------------------------------------------------------------- 1 | cd protos 2 | protoc-gen-grpc --plugin=protoc-gen-ts=..\node_modules\.bin\protoc-gen-ts.cmd --js_out="import_style=commonjs,binary:../src/generated" --ts_out="service=grpc-node:../src/generated" --grpc_out="../src/generated" rowlevelsecurity.proto 3 | cd .. -------------------------------------------------------------------------------- /typescript-client/rowlevelsecurity/jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | preset: 'ts-jest', 3 | testEnvironment: 'node', 4 | testResultsProcessor: 'jest-sonar-reporter', 5 | coveragePathIgnorePatterns: [ 6 | "/node_modules/", 7 | "/test/", 8 | "/generated/" 9 | ], 10 | testPathIgnorePatterns: ["lib"] 11 | }; -------------------------------------------------------------------------------- /typescript-client/rowlevelsecurity/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@koralium/rowlevelsecurity-client", 3 | "version": "1.0.5", 4 | "main": "./lib/index.js", 5 | "license": "MIT", 6 | "scripts": { 7 | "build": "tsc --build", 8 | "clean": "tsc --build --clean", 9 | "test": "jest", 10 | "coverage": "jest --coverage", 11 | "publish-package": "npm publish --access public" 12 | }, 13 | "devDependencies": { 14 | "@types/chai": "^4.2.11", 15 | "@types/google-protobuf": "^3.7.2", 16 | "@types/jest": "^26.0.3", 17 | "@types/node": "^14.0.14", 18 | "chai": "4.2.0", 19 | "chai-arrays": "^2.2.0", 20 | "cross-env": "5.2.0", 21 | "grpc-tools": "^1.9.0", 22 | "jest": "^26.1.0", 23 | "jest-editor-support": "^27.2.0", 24 | "jest-sonar-reporter": "^2.0.0", 25 | "neat-csv": "^5.2.0", 26 | "nyc": "14.1.1", 27 | "testcontainers": "^2.14.0", 28 | "ts-jest": "^26.1.1", 29 | "ts-node": "^8.10.2", 30 | "ts-protoc-gen": "^0.12.0", 31 | "typescript": "^3.2.2" 32 | }, 33 | "dependencies": { 34 | "google-protobuf": "^3.14.0", 35 | "grpc": "^1.24.3", 36 | "node-cache": "^5.1.2" 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /typescript-client/rowlevelsecurity/protos/rowlevelsecurity.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | 4 | option csharp_namespace = "Koralium.Transport.RowLevelSecurity"; 5 | 6 | service KoraliumRowLevelSecurity { 7 | rpc GetRowLevelSecurityFilter (RowLevelSecurityRequest) returns (RowLevelSecurityResponse); 8 | } 9 | 10 | enum Format { 11 | sql = 0; 12 | elasticsearch = 1; 13 | cubejs = 2; 14 | } 15 | 16 | message RowLevelSecurityRequest { 17 | 18 | // Table name to get row level security filter for 19 | string tableName = 1; 20 | 21 | //Which format to output the filter in 22 | Format format = 3; 23 | 24 | oneof formatOptions { 25 | SqlOptions sqlOptions = 4; 26 | ElasticSearchOptions elasticSearchOptions = 5; 27 | CubeJsOptions cubejsOptions = 6; 28 | } 29 | } 30 | 31 | message RowLevelSecurityResponse { 32 | string filter = 1; 33 | } 34 | 35 | message SqlOptions { 36 | string tableAlias = 1; 37 | } 38 | 39 | message ElasticSearchOptions { 40 | bool lowerCaseStringValues = 1; 41 | } 42 | 43 | message CubeJsOptions { 44 | string cubeName = 1; 45 | bool lowerCaseFirstMemberCharacter = 2; 46 | } -------------------------------------------------------------------------------- /typescript-client/rowlevelsecurity/src/cubejsModels.ts: -------------------------------------------------------------------------------- 1 | export interface QueryFilter { 2 | member: string; 3 | operator: 'equals' | 'notEquals' | 'contains' | 'notContains' | 'gt' | 'gte' | 'lt' | 'lte' | 'set' | 'notSet' | 'inDateRange' | 'notInDateRange' | 'beforeDate' | 'afterDate'; 4 | values?: string[]; 5 | } 6 | 7 | export interface BinaryFilter { 8 | or?: Array 9 | and?: Array 10 | } 11 | 12 | export declare type QueryTimeDimensionGranularity = 'hour' | 'day' | 'week' | 'month' | 'year'; 13 | interface QueryTimeDimension { 14 | dimension: string; 15 | dateRange?: string[] | string; 16 | granularity?: QueryTimeDimensionGranularity; 17 | } 18 | 19 | export interface Query { 20 | measures?: string[]; 21 | dimensions?: string[]; 22 | filters?: (QueryFilter | BinaryFilter)[]; 23 | timeDimensions?: QueryTimeDimension[]; 24 | segments?: string[]; 25 | limit?: number; 26 | offset?: number; 27 | order?: 'asc' | 'desc'; 28 | timezone?: string; 29 | renewQuery?: boolean; 30 | ungrouped?: boolean; 31 | } -------------------------------------------------------------------------------- /typescript-client/rowlevelsecurity/src/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | export * from './rowLevelSecurityClient' 15 | export * from './koraliumCubeJsQueryTransformer' -------------------------------------------------------------------------------- /typescript-client/rowlevelsecurity/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "target": "es6", 5 | "lib": ["es6"], 6 | "sourceMap": true, 7 | "outDir": "lib", 8 | "esModuleInterop": true, 9 | "allowJs": true, 10 | "declaration": true, 11 | "strict": true, 12 | "noImplicitAny": true, 13 | "strictNullChecks": true 14 | }, 15 | "exclude": [ 16 | "node_modules", 17 | "tests", 18 | "lib", 19 | "jest.config.*" 20 | ] 21 | } 22 | --------------------------------------------------------------------------------