You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@asterixdb.apache.org by mb...@apache.org on 2020/06/26 00:02:06 UTC
[asterixdb] 03/04: Merge commit 'c25c36d1b0' from
'gerrit/mad-hatter'
This is an automated email from the ASF dual-hosted git repository.
mblow pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/asterixdb.git
commit 7ac75e7ba9966fa11e794bd839f22e5a6669c45a
Merge: 44809d7 c25c36d
Author: Hussain Towaileb <Hu...@Gmail.com>
AuthorDate: Wed Jun 24 19:12:32 2020 +0300
Merge commit 'c25c36d1b0' from 'gerrit/mad-hatter'
Change-Id: I8a78950cb81f0a29ceae94fa439eec700c17d06d
.../optimizer/rules/ConstantFoldingRule.java | 4 ++-
.../asterix/app/translator/QueryTranslator.java | 18 +++++-----
.../apache/asterix/test/common/TestExecutor.java | 1 -
.../test.000.ddl.sqlpp} | 35 ++++++++++----------
.../test.001.query.sqlpp} | 22 ++-----------
.../test.099.ddl.sqlpp} | 20 +-----------
.../exclude-all-files/test.000.ddl.sqlpp} | 35 ++++++++++----------
.../exclude-all-files/test.001.query.sqlpp} | 22 ++-----------
.../exclude-all-files/test.099.ddl.sqlpp} | 20 +-----------
.../include-no-files/test.000.ddl.sqlpp} | 35 ++++++++++----------
.../include-no-files/test.001.query.sqlpp} | 22 ++-----------
.../include-no-files/test.099.ddl.sqlpp} | 20 +-----------
.../definition-points-to-nothing/result.001.adm | 1 +
.../exclude-all-files/result.001.adm | 1 +
.../include-no-files/result.001.adm | 1 +
.../runtimets/testsuite_external_dataset.xml | 18 ++++++++++
.../test/resources/runtimets/testsuite_sqlpp.xml | 22 ++++++-------
.../asterix/common/exceptions/ErrorCode.java | 15 +++++----
.../common/exceptions/NoOpWarningCollector.java} | 28 ++++++++++------
.../asterix/common/external/IAdapterFactory.java | 6 ++--
.../src/main/resources/asx_errormsg/en.properties | 15 +++++----
.../adapter/factory/GenericAdapterFactory.java | 15 +++++----
.../adapter/factory/LookupAdapterFactory.java | 10 +++---
.../external/api/IExternalDataSourceFactory.java | 3 +-
.../external/input/HDFSDataSourceFactory.java | 4 ++-
.../record/reader/aws/AwsS3InputStreamFactory.java | 17 +++++++---
.../record/reader/aws/AwsS3ReaderFactory.java | 5 +--
.../reader/hdfs/HDFSLookupReaderFactory.java | 4 ++-
.../reader/http/HttpServerRecordReaderFactory.java | 4 ++-
.../record/reader/rss/RSSRecordReaderFactory.java | 4 ++-
.../reader/stream/StreamRecordReaderFactory.java | 7 ++--
.../reader/twitter/TwitterRecordReaderFactory.java | 4 ++-
.../stream/factory/LocalFSInputStreamFactory.java | 4 ++-
.../factory/SocketClientInputStreamFactory.java | 4 ++-
.../factory/SocketServerInputStreamFactory.java | 4 ++-
.../factory/TwitterFirehoseStreamFactory.java | 4 ++-
.../operators/FeedIntakeOperatorDescriptor.java | 3 +-
.../external/provider/AdapterFactoryProvider.java | 15 +++++----
.../provider/LookupReaderFactoryProvider.java | 5 +--
.../asterix/external/util/ExternalDataUtils.java | 38 ++++++++++++++++++----
.../apache/asterix/external/util/ParseUtil.java | 5 +--
.../reader/RecordWithPKTestReaderFactory.java | 4 ++-
.../record/reader/kv/KVTestReaderFactory.java | 4 ++-
.../library/adapter/TestTypedAdapterFactory.java | 4 ++-
.../metadata/declared/DatasetDataSource.java | 5 +--
.../declared/FunctionDataSourceFactory.java | 3 +-
.../metadata/declared/LoadableDataSource.java | 2 +-
.../metadata/declared/MetadataProvider.java | 11 ++++---
.../asterix/metadata/feeds/FeedMetadataUtil.java | 12 ++++---
.../metadata/utils/ExternalIndexingOperations.java | 3 +-
.../api/HeuristicCompilerFactoryBuilder.java | 2 +-
.../algebricks/core/jobgen/impl/JobGenContext.java | 10 +++++-
.../hyracks/api/exceptions/SourceLocation.java | 18 +++++++---
.../org/apache/hyracks/api/exceptions/Warning.java | 3 +-
.../file/FieldCursorForDelimitedDataParser.java | 4 +--
55 files changed, 311 insertions(+), 294 deletions(-)
diff --cc asterixdb/asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/ConstantFoldingRule.java
index 2b703a2,494b1b4..4ca3275
--- a/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/ConstantFoldingRule.java
+++ b/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/ConstantFoldingRule.java
@@@ -29,9 -29,9 +29,10 @@@ import org.apache.asterix.common.config
import org.apache.asterix.common.dataflow.ICcApplicationContext;
import org.apache.asterix.common.exceptions.CompilationException;
import org.apache.asterix.common.exceptions.ErrorCode;
+ import org.apache.asterix.common.exceptions.NoOpWarningCollector;
import org.apache.asterix.common.exceptions.WarningCollector;
import org.apache.asterix.common.exceptions.WarningUtil;
+import org.apache.asterix.common.functions.ExternalFunctionLanguage;
import org.apache.asterix.dataflow.data.common.ExpressionTypeComputer;
import org.apache.asterix.dataflow.data.nontagged.MissingWriterFactory;
import org.apache.asterix.formats.nontagged.ADMPrinterFactoryProvider;
diff --cc asterixdb/asterix-app/src/main/java/org/apache/asterix/app/translator/QueryTranslator.java
index a5fef11,0f669ef..d1c5aeb
--- a/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/translator/QueryTranslator.java
+++ b/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/translator/QueryTranslator.java
@@@ -882,8 -851,9 +881,9 @@@ public class QueryTranslator extends Ab
}
}
- protected Map<String, String> createExternalDatasetProperties(String dataverseName, DatasetDecl dd,
+ protected Map<String, String> createExternalDatasetProperties(DataverseName dataverseName, DatasetDecl dd,
- MetadataProvider metadataProvider, MetadataTransactionContext mdTxnCtx) throws AlgebricksException {
+ Datatype itemType, MetadataProvider metadataProvider, MetadataTransactionContext mdTxnCtx)
+ throws AlgebricksException {
ExternalDetailsDecl externalDetails = (ExternalDetailsDecl) dd.getDatasetDetailsDecl();
return externalDetails.getProperties();
}
diff --cc asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml
index e1f3084,63773dd..1b9c610
--- a/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml
@@@ -2862,23 -2837,6 +2862,23 @@@
</compilation-unit>
</test-case>
</test-group>
+ <test-group name="aggregate-subclause">
+ <test-case FilePath="aggregate-subclause">
+ <compilation-unit name="agg_filter_01">
+ <output-dir compare="Text">agg_filter_01</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="aggregate-subclause">
+ <compilation-unit name="agg_filter_02_neg">
+ <output-dir compare="Text">agg_filter_01</output-dir>
- <expected-error>ASX1120: Illegal use of aggregate FILTER clause</expected-error>
- <expected-error>ASX1120: Illegal use of aggregate FILTER clause</expected-error>
++ <expected-error>ASX1121: Illegal use of aggregate FILTER clause</expected-error>
++ <expected-error>ASX1121: Illegal use of aggregate FILTER clause</expected-error>
+ <expected-error>ASX1073: Cannot resolve alias reference for undefined identifier r</expected-error>
- <expected-error>ASX1120: Illegal use of aggregate FILTER clause</expected-error>
- <expected-error>ASX1120: Illegal use of aggregate FILTER clause</expected-error>
++ <expected-error>ASX1121: Illegal use of aggregate FILTER clause</expected-error>
++ <expected-error>ASX1121: Illegal use of aggregate FILTER clause</expected-error>
+ </compilation-unit>
+ </test-case>
+ </test-group>
<test-group name="array_fun">
<test-case FilePath="array_fun">
<compilation-unit name="array_prepend">
@@@ -5612,29 -5406,6 +5612,29 @@@
</compilation-unit>
</test-case>
<test-case FilePath="group-by">
+ <compilation-unit name="grouping-sets-1">
+ <output-dir compare="Text">grouping-sets-1</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="group-by">
+ <compilation-unit name="grouping-sets-2">
+ <output-dir compare="Text">grouping-sets-2</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="group-by">
+ <compilation-unit name="grouping-sets-3-negative">
+ <output-dir compare="Text">grouping-sets-2</output-dir>
- <expected-error>ASX1119: Unexpected alias: v21</expected-error>
- <expected-error>ASX1119: Unexpected alias: v22</expected-error>
- <expected-error>ASX1119: Unexpected alias: v23</expected-error>
++ <expected-error>ASX1120: Unexpected alias: v21</expected-error>
++ <expected-error>ASX1120: Unexpected alias: v22</expected-error>
++ <expected-error>ASX1120: Unexpected alias: v23</expected-error>
+ <expected-error>ASX1087: Invalid number of arguments for function grouping</expected-error>
- <expected-error>ASX1118: Invalid argument to grouping() function</expected-error>
- <expected-error>ASX1118: Invalid argument to grouping() function</expected-error>
- <expected-error>ASX1118: Invalid argument to grouping() function</expected-error>
- <expected-error>ASX1117: Too many grouping sets in group by clause: 512. Maximum allowed: 128.</expected-error>
++ <expected-error>ASX1119: Invalid argument to grouping() function</expected-error>
++ <expected-error>ASX1119: Invalid argument to grouping() function</expected-error>
++ <expected-error>ASX1119: Invalid argument to grouping() function</expected-error>
++ <expected-error>ASX1118: Too many grouping sets in group by clause: 512. Maximum allowed: 128.</expected-error>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="group-by">
<compilation-unit name="having">
<output-dir compare="Text">core-02</output-dir>
</compilation-unit>
diff --cc asterixdb/asterix-common/src/main/java/org/apache/asterix/common/exceptions/ErrorCode.java
index 503ff6e,d57c433..fdba8d6
--- a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/exceptions/ErrorCode.java
+++ b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/exceptions/ErrorCode.java
@@@ -203,13 -202,7 +203,14 @@@ public class ErrorCode
public static final int PROPERTY_INVALID_VALUE_TYPE = 1111;
public static final int INVALID_PROPERTY_FORMAT = 1112;
public static final int INVALID_REGEX_PATTERN = 1113;
- public static final int SYNONYM_EXISTS = 1114;
- public static final int UNKNOWN_SYNONYM = 1115;
- public static final int UNKNOWN_LIBRARY = 1116;
- public static final int COMPILATION_GROUPING_SETS_OVERFLOW = 1117;
- public static final int COMPILATION_GROUPING_OPERATION_INVALID_ARG = 1118;
- public static final int COMPILATION_UNEXPECTED_ALIAS = 1119;
- public static final int COMPILATION_ILLEGAL_USE_OF_FILTER_CLAUSE = 1120;
+ public static final int EXTERNAL_SOURCE_CONFIGURATION_RETURNED_NO_FILES = 1114;
++ public static final int SYNONYM_EXISTS = 1115;
++ public static final int UNKNOWN_SYNONYM = 1116;
++ public static final int UNKNOWN_LIBRARY = 1117;
++ public static final int COMPILATION_GROUPING_SETS_OVERFLOW = 1118;
++ public static final int COMPILATION_GROUPING_OPERATION_INVALID_ARG = 1119;
++ public static final int COMPILATION_UNEXPECTED_ALIAS = 1120;
++ public static final int COMPILATION_ILLEGAL_USE_OF_FILTER_CLAUSE = 1121;
// Feed errors
public static final int DATAFLOW_ILLEGAL_STATE = 3001;
diff --cc asterixdb/asterix-common/src/main/resources/asx_errormsg/en.properties
index e612503,5cf3968..9bbebf2
--- a/asterixdb/asterix-common/src/main/resources/asx_errormsg/en.properties
+++ b/asterixdb/asterix-common/src/main/resources/asx_errormsg/en.properties
@@@ -198,13 -197,7 +198,14 @@@
1111 = Property \"%1$s\" expects value(s) of type %2$s
1112 = Invalid format for property \"%1$s\"
1113 = Invalid pattern %1$s
- 1114 = A synonym with this name %1$s already exists
- 1115 = Cannot find synonym with name %1$s
- 1116 = Unknown library %1$s
- 1117 = Too many grouping sets in group by clause: %1$s. Maximum allowed: %2$s.
- 1118 = Invalid argument to grouping() function
- 1119 = Unexpected alias: %1$s
- 1120 = Illegal use of aggregate FILTER clause
+ 1114 = The provided external dataset configuration returned no files from the external source
++1115 = A synonym with this name %1$s already exists
++1116 = Cannot find synonym with name %1$s
++1117 = Unknown library %1$s
++1118 = Too many grouping sets in group by clause: %1$s. Maximum allowed: %2$s.
++1119 = Invalid argument to grouping() function
++1120 = Unexpected alias: %1$s
++1121 = Illegal use of aggregate FILTER clause
# Feed Errors
3001 = Illegal state.
diff --cc asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/ExternalDataUtils.java
index f0c6422,1300ac3..052a8e0
--- a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/ExternalDataUtils.java
+++ b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/ExternalDataUtils.java
@@@ -37,10 -37,8 +37,11 @@@ import org.apache.asterix.common.except
import org.apache.asterix.common.exceptions.CompilationException;
import org.apache.asterix.common.exceptions.ErrorCode;
import org.apache.asterix.common.exceptions.RuntimeDataException;
+ import org.apache.asterix.common.exceptions.WarningUtil;
+import org.apache.asterix.common.functions.ExternalFunctionLanguage;
+import org.apache.asterix.common.library.ILibrary;
import org.apache.asterix.common.library.ILibraryManager;
+import org.apache.asterix.common.metadata.DataverseName;
import org.apache.asterix.external.api.IDataParserFactory;
import org.apache.asterix.external.api.IExternalDataSourceFactory.DataSourceType;
import org.apache.asterix.external.api.IInputStreamFactory;
diff --cc asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/declared/MetadataProvider.java
index 3107a00,c5109b7..3f5d0b0
--- a/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/declared/MetadataProvider.java
+++ b/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/declared/MetadataProvider.java
@@@ -823,11 -782,13 +824,13 @@@ public class MetadataProvider implement
}
protected ITypedAdapterFactory getConfiguredAdapterFactory(Dataset dataset, String adapterName,
- Map<String, String> configuration, ARecordType itemType, ARecordType metaType) throws AlgebricksException {
+ Map<String, String> configuration, ARecordType itemType, ARecordType metaType,
+ IWarningCollector warningCollector) throws AlgebricksException {
try {
- configuration.put(ExternalDataConstants.KEY_DATAVERSE, dataset.getDataverseName());
+ configuration.put(ExternalDataConstants.KEY_DATAVERSE, dataset.getDataverseName().getCanonicalForm());
- ITypedAdapterFactory adapterFactory = AdapterFactoryProvider.getAdapterFactory(
- getApplicationContext().getServiceContext(), adapterName, configuration, itemType, metaType);
+ ITypedAdapterFactory adapterFactory =
+ AdapterFactoryProvider.getAdapterFactory(getApplicationContext().getServiceContext(), adapterName,
+ configuration, itemType, metaType, warningCollector);
// check to see if dataset is indexed
Index filesIndex =
diff --cc asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/feeds/FeedMetadataUtil.java
index e0a8e83,792501b..24301e0
--- a/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/feeds/FeedMetadataUtil.java
+++ b/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/feeds/FeedMetadataUtil.java
@@@ -28,11 -28,9 +28,12 @@@ import org.apache.asterix.common.except
import org.apache.asterix.common.exceptions.CompilationException;
import org.apache.asterix.common.exceptions.ErrorCode;
import org.apache.asterix.common.exceptions.MetadataException;
+ import org.apache.asterix.common.exceptions.NoOpWarningCollector;
import org.apache.asterix.common.external.IDataSourceAdapter;
import org.apache.asterix.common.external.IDataSourceAdapter.AdapterType;
+import org.apache.asterix.common.functions.ExternalFunctionLanguage;
+import org.apache.asterix.common.library.ILibrary;
+import org.apache.asterix.common.metadata.DataverseName;
import org.apache.asterix.external.api.ITypedAdapterFactory;
import org.apache.asterix.external.feed.api.IFeed;
import org.apache.asterix.external.feed.policy.FeedPolicyAccessor;
@@@ -56,7 -53,7 +57,8 @@@ import org.apache.hyracks.algebricks.co
import org.apache.hyracks.algebricks.common.utils.Triple;
import org.apache.hyracks.api.dataflow.value.ISerializerDeserializer;
import org.apache.hyracks.api.dataflow.value.RecordDescriptor;
+import org.apache.hyracks.api.exceptions.HyracksDataException;
+ import org.apache.hyracks.api.exceptions.IWarningCollector;
/**
* A utility class for providing helper functions for feeds TODO: Refactor this