This is an automated email from the ASF dual-hosted git repository. mhubail pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/asterixdb.git
commit 8b076b8f720e473fa0e8535ab8e420e95863f6b8 Merge: f805cfc4c6 ed4bd17f06 Author: Michael Blow <michael.b...@couchbase.com> AuthorDate: Sat Apr 27 20:25:28 2024 -0400 Merge branch 'gerrit/neo' into 'gerrit/trinity' Change-Id: I312b65d84030f7f4557bec637f966d2003aa17a4 .../SqlppExpressionToPlanTranslator.java | 12 +- .../apache/asterix/api/common/APIFramework.java | 2 +- .../app/resource/OperatorResourcesComputer.java | 71 +++- .../org/apache/asterix/utils/ResourceUtils.java | 25 +- .../app/resource/PlanStagesGeneratorTest.java | 2 +- .../asterix/runtime/PartitionManagerTest.java | 2 +- .../aggregate-sql/median/median.01.ddl.sqlpp | 29 ++ .../aggregate-sql/median/median.02.update.sqlpp | 44 +++ .../aggregate-sql/median/median.03.query.sqlpp | 22 ++ .../aggregate-sql/median/median.04.query.sqlpp | 22 ++ .../aggregate-sql/median/median.05.query.sqlpp | 23 ++ .../aggregate-sql/median/median.06.query.sqlpp | 23 ++ .../aggregate-sql/median/median.07.query.sqlpp | 23 ++ .../aggregate-sql/median/median.08.query.sqlpp | 23 ++ .../aggregate-sql/median/median.09.query.sqlpp | 23 ++ .../aggregate-sql/median/median.10.query.sqlpp | 25 ++ .../aggregate-sql/median/median.11.query.sqlpp | 23 ++ .../aggregate-sql/median/median.99.ddl.sqlpp | 20 ++ .../results/aggregate-sql/median/median.03.adm | 1 + .../results/aggregate-sql/median/median.04.adm | 1 + .../results/aggregate-sql/median/median.05.adm | 1 + .../results/aggregate-sql/median/median.06.adm | 1 + .../results/aggregate-sql/median/median.07.adm | 1 + .../results/aggregate-sql/median/median.08.adm | 1 + .../results/aggregate-sql/median/median.09.adm | 1 + .../results/aggregate-sql/median/median.10.adm | 15 + .../results/aggregate-sql/median/median.11.adm | 1 + .../test/resources/runtimets/testsuite_sqlpp.xml | 5 + .../asterix/common/config/CompilerProperties.java | 5 + .../common/config/OptimizationConfUtil.java | 2 +- .../src/main/markdown/builtins/9_aggregate_sql.md | 91 +++-- .../asterix-doc/src/main/markdown/sqlpp/3_query.md | 13 +- .../src/main/markdown/sqlpp/4_windowfunctions.md | 4 +- .../asterix/om/functions/BuiltinFunctions.java | 53 +++ .../typecomputer/impl/LocalMedianTypeComputer.java | 44 +++ .../test/om/typecomputer/TypeComputerTest.java | 2 + .../scalar/ScalarSqlMedianAggregateDescriptor.java | 60 ++++ .../std/AbstractLocalMedianAggregateFunction.java | 176 ++++++++++ .../std/AbstractMedianAggregateFunction.java | 380 +++++++++++++++++++++ .../std/GlobalSqlMedianAggregateDescriptor.java | 54 +++ .../std/GlobalSqlMedianAggregateFunction.java | 51 +++ .../IntermediateSqlMedianAggregateDescriptor.java | 54 +++ .../IntermediateSqlMedianAggregateFunction.java | 50 +++ .../std/LocalSqlMedianAggregateDescriptor.java | 75 ++++ .../std/LocalSqlMedianAggregateFunction.java | 50 +++ .../std/SqlMedianAggregateDescriptor.java | 77 +++++ .../aggregates/std/SqlMedianAggregateFunction.java | 85 +++++ .../runtime/functions/FunctionCollection.java | 10 + .../runtime/functions/FunctionTypeInferers.java | 3 + .../hyracks/api/context/IHyracksJobletContext.java | 2 + ...utChannel.java => FileNetworkInputChannel.java} | 57 ++-- .../hyracks/comm/channels/NetworkInputChannel.java | 4 +- .../java/org/apache/hyracks/control/nc/Joblet.java | 7 + .../hyracks/control/nc/net/NetworkManager.java | 45 ++- .../control/nc/partitions/JobFileState.java | 92 +++++ .../nc/partitions/MaterializedPartition.java | 43 +-- .../control/nc/partitions/PartitionFileReader.java | 91 +++++ .../nc/partitions/PartitionFileReaderUtil.java | 58 ++++ .../control/nc/partitions/PartitionManager.java | 23 ++ .../hyracks/dataflow/common/io/RunFileReader.java | 4 + .../hyracks/test/support/TestJobletContext.java | 7 + 61 files changed, 2078 insertions(+), 136 deletions(-) diff --cc asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/functions/FunctionTypeInferers.java index 5abebd2a18,7d484b6a89..9c25f6ebfd --- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/functions/FunctionTypeInferers.java +++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/functions/FunctionTypeInferers.java @@@ -116,16 -116,9 +116,19 @@@ public final class FunctionTypeInferer } }; + public static final IFunctionTypeInferer MEDIAN_MEMORY = + (expr, fd, context, compilerProps) -> fd.setImmutableStates(compilerProps.getSortMemoryFrames()); + + public static final IFunctionTypeInferer RECORD_MODIFY_INFERER = (expr, fd, context, compilerProps) -> { + AbstractFunctionCallExpression f = (AbstractFunctionCallExpression) expr; + IAType outType = (IAType) context.getType(expr); + IAType inType = (IAType) context.getType(f.getArguments().get(0).getValue()); + if (inType.getTypeTag().equals(ATypeTag.ANY)) { + inType = DefaultOpenFieldType.NESTED_OPEN_RECORD_TYPE; + } + fd.setImmutableStates(outType, inType); + }; + public static final class CastTypeInferer implements IFunctionTypeInferer { @Override public void infer(ILogicalExpression expr, IFunctionDescriptor fd, IVariableTypeEnvironment context,