Java Code Examples for org.apache.calcite.sql.validate.SqlValidatorException

The following examples show how to use org.apache.calcite.sql.validate.SqlValidatorException. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: kylin-on-parquet-v2   Source File: PushDownExecutor.java    License: Apache License 2.0 5 votes vote down vote up
private static boolean isExpectedCause(SQLException sqlException) {
    Preconditions.checkArgument(sqlException != null);
    Throwable rootCause = ExceptionUtils.getRootCause(sqlException);

    //SqlValidatorException is not an excepted exception in the origin design.But in the multi pass scene,
    //query pushdown may create tables, and the tables are not in the model, so will throw SqlValidatorException.
    boolean isPushDownUpdateEnabled = KylinConfig.getInstanceFromEnv().isPushDownUpdateEnabled();

    if (isPushDownUpdateEnabled) {
        return (rootCause instanceof NoRealizationFoundException //
                || rootCause instanceof RoutingIndicatorException || rootCause instanceof SqlValidatorException); //
    } else {
        if (rootCause instanceof KylinTimeoutException)
            return false;
        if (rootCause instanceof AccessDeniedException) {
            return false;
        }
        if (rootCause instanceof RoutingIndicatorException) {
            return true;
        }

        if (rootCause instanceof CompileException) {
            return true;
        }

        if (QueryContextFacade.current().isWithoutSyntaxError()) {
            logger.warn("route to push down for met error when running current query", sqlException);
            return true;
        }
    }

    return false;
}
 
Example 2
Source Project: Bats   Source File: CalciteResource.java    License: Apache License 2.0 4 votes vote down vote up
@BaseMessage("Empty window specification not allowed")
ExInst<SqlValidatorException> emptyWindowSpec();
 
Example 3
Source Project: Bats   Source File: CalciteResource.java    License: Apache License 2.0 4 votes vote down vote up
@BaseMessage("Duplicate relation name ''{0}'' in FROM clause")
ExInst<SqlValidatorException> fromAliasDuplicate(String a0);
 
Example 4
Source Project: Bats   Source File: CalciteResource.java    License: Apache License 2.0 4 votes vote down vote up
@BaseMessage("View is not modifiable. More than one expression maps to column ''{0}'' of base table ''{1}''")
ExInst<SqlValidatorException> moreThanOneMappedColumn(String columnName, String tableName);
 
Example 5
Source Project: Bats   Source File: CalciteResource.java    License: Apache License 2.0 4 votes vote down vote up
@BaseMessage("Upper frame boundary cannot be PRECEDING when lower boundary is FOLLOWING")
ExInst<SqlValidatorException> followingBeforePrecedingError();
 
Example 6
Source Project: Bats   Source File: CalciteResource.java    License: Apache License 2.0 4 votes vote down vote up
@BaseMessage("The system time period specification expects Timestamp type but is ''{0}''")
ExInst<SqlValidatorException> illegalExpressionForTemporal(String type);
 
Example 7
Source Project: Bats   Source File: CalciteResource.java    License: Apache License 2.0 4 votes vote down vote up
@BaseMessage("Modifiable view must be predicated only on equality expressions")
ExInst<SqlValidatorException> modifiableViewMustHaveOnlyEqualityPredicates();
 
Example 8
Source Project: Bats   Source File: CalciteResource.java    License: Apache License 2.0 4 votes vote down vote up
@BaseMessage("Geo-spatial extensions and the GEOMETRY data type are not enabled")
ExInst<SqlValidatorException> geometryDisabled();
 
Example 9
Source Project: Bats   Source File: CalciteResource.java    License: Apache License 2.0 4 votes vote down vote up
@BaseMessage("Must contain an ORDER BY clause when WITHIN is used")
ExInst<SqlValidatorException> cannotUseWithinWithoutOrderBy();
 
Example 10
Source Project: Bats   Source File: CalciteResource.java    License: Apache License 2.0 4 votes vote down vote up
@BaseMessage("No match found for function signature {0}")
ExInst<SqlValidatorException> validatorUnknownFunction(String a0);
 
Example 11
Source Project: Bats   Source File: CalciteResource.java    License: Apache License 2.0 4 votes vote down vote up
@BaseMessage("Null parameters in ''{0}''")
ExInst<SqlValidatorException> patternFunctionNullCheck(String call);
 
Example 12
Source Project: Bats   Source File: CalciteResource.java    License: Apache License 2.0 4 votes vote down vote up
@BaseMessage("ORDER BY expression should not contain OVER clause")
ExInst<SqlValidatorException> orderbyShouldNotContainOver();
 
Example 13
Source Project: Bats   Source File: CalciteResource.java    License: Apache License 2.0 4 votes vote down vote up
@BaseMessage("Modifiable view must be based on a single table")
ExInst<SqlValidatorException> modifiableViewMustBeBasedOnSingleTable();
 
Example 14
Source Project: Bats   Source File: CalciteResource.java    License: Apache License 2.0 4 votes vote down vote up
@BaseMessage("Values passed to {0} operator must have compatible types")
ExInst<SqlValidatorException> incompatibleValueType(String a0);
 
Example 15
Source Project: Bats   Source File: CalciteResource.java    License: Apache License 2.0 4 votes vote down vote up
@BaseMessage("Streaming ORDER BY must start with monotonic expression")
ExInst<SqlValidatorException> streamMustOrderByMonotonic();
 
Example 16
Source Project: Bats   Source File: CalciteResource.java    License: Apache License 2.0 4 votes vote down vote up
@BaseMessage("Cannot apply {0} to the two different charsets {1} and {2}")
ExInst<SqlValidatorException> incompatibleCharset(String a0, String a1,
    String a2);
 
Example 17
Source Project: Bats   Source File: CalciteResource.java    License: Apache License 2.0 4 votes vote down vote up
@BaseMessage("Not allowed to perform {0} on {1}")
ExInst<SqlValidatorException> accessNotAllowed(String a0, String a1);
 
Example 18
Source Project: Bats   Source File: CalciteResource.java    License: Apache License 2.0 4 votes vote down vote up
@BaseMessage("Referenced window cannot have framing declarations")
ExInst<SqlValidatorException> refWindowWithFrame();
 
Example 19
Source Project: Bats   Source File: CalciteResource.java    License: Apache License 2.0 4 votes vote down vote up
@BaseMessage("Interval field value {0,number} exceeds precision of {1} field")
ExInst<SqlValidatorException> intervalFieldExceedsPrecision(Number a0,
    String a1);
 
Example 20
Source Project: Bats   Source File: CalciteResource.java    License: Apache License 2.0 4 votes vote down vote up
@BaseMessage("Unknown target column ''{0}''")
ExInst<SqlValidatorException> unknownTargetColumn(String a0);
 
Example 21
Source Project: Bats   Source File: CalciteResource.java    License: Apache License 2.0 4 votes vote down vote up
@BaseMessage("Target column ''{0}'' is assigned more than once")
ExInst<SqlValidatorException> duplicateTargetColumn(String a0);
 
Example 22
Source Project: Bats   Source File: CalciteResource.java    License: Apache License 2.0 4 votes vote down vote up
@BaseMessage("Number of INSERT target columns ({0,number}) does not equal number of source items ({1,number})")
ExInst<SqlValidatorException> unmatchInsertColumn(int a0, int a1);
 
Example 23
Source Project: Bats   Source File: CalciteResource.java    License: Apache License 2.0 4 votes vote down vote up
@BaseMessage("Column ''{0}'' has no default value and does not allow NULLs")
ExInst<SqlValidatorException> columnNotNullable(String a0);
 
Example 24
Source Project: Bats   Source File: CalciteResource.java    License: Apache License 2.0 4 votes vote down vote up
@BaseMessage("Schema ''{0}'' already exists")
ExInst<SqlValidatorException> schemaExists(String name);
 
Example 25
Source Project: Bats   Source File: CalciteResource.java    License: Apache License 2.0 4 votes vote down vote up
@BaseMessage("Cannot resolve ''{0}''; it references view ''{1}'', whose definition is cyclic")
ExInst<SqlValidatorException> cyclicDefinition(String id, String view);
 
Example 26
Source Project: Bats   Source File: CalciteResource.java    License: Apache License 2.0 4 votes vote down vote up
@BaseMessage("Table ''{0}'' not found; did you mean ''{1}''?")
ExInst<SqlValidatorException> tableNameNotFoundDidYouMean(String a0,
    String a1);
 
Example 27
Source Project: Bats   Source File: CalciteResource.java    License: Apache License 2.0 4 votes vote down vote up
@BaseMessage("Object ''{0}'' not found")
ExInst<SqlValidatorException> objectNotFound(String a0);
 
Example 28
Source Project: Bats   Source File: CalciteResource.java    License: Apache License 2.0 4 votes vote down vote up
@BaseMessage("Object ''{0}'' not found within ''{1}''")
ExInst<SqlValidatorException> objectNotFoundWithin(String a0, String a1);
 
Example 29
Source Project: Bats   Source File: CalciteResource.java    License: Apache License 2.0 4 votes vote down vote up
@BaseMessage("Invalid number of parameters to COUNT method")
ExInst<SqlValidatorException> patternCountFunctionArg();
 
Example 30
Source Project: Bats   Source File: CalciteResource.java    License: Apache License 2.0 4 votes vote down vote up
@BaseMessage("Object ''{0}'' not found within ''{1}''; did you mean ''{2}''?")
ExInst<SqlValidatorException> objectNotFoundWithinDidYouMean(String a0,
    String a1, String a2);