-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: report clearer error message when AVG used with DELIMITED (#4295)
See #4294 `AVG` doesn't work with `DELIMITED` format and the error message isn't great. Example statements that cause the error: ```sql -- Given: CREATE STREAM INPUT (VALUE integer) WITH (kafka_topic='test_topic', value_format='DELIMITED'); -- When: CREATE TABLE OUTPUT AS SELECT avg(value) AS avg FROM INPUT group by ROWKEY; ``` Old error message: ``` ksql> CREATE TABLE OUTPUT AS SELECT avg(value) AS avg FROM INPUT group by ROWKEY; CREATE TABLE OUTPUT AS SELECT avg(value)Value format does not support value schema. format: DELIMITED schema: Persistence{schema=STRUCT<KSQL_INTERNAL_COL_0 INT, KSQL_INTERNAL_COL_1 VARCHAR, KSQL_AGG_VARIABLE_0 STRUCT<SUM INT, COUNT BIGINT>> NOT NULL, unwrapped=false} reason: The 'DELIMITED' format does not support type 'STRUCT' Caused by: The 'DELIMITED' format does not support type 'STRUCT' ``` This PR improves the error message a bit: New error message: ``` One of the functions used in the statement has an intermediate type that the value format can not handle. Please remove the function or change the format. Consider up-voting #3950, which will resolve this limitation Caused by: Value format does not support value schema. format: DELIMITED schema: Persistence{schema=STRUCT<KSQL_INTERNAL_COL_0 INT, KSQL_INTERNAL_COL_1 VARCHAR, KSQL_AGG_VARIABLE_0 STRUCT<SUM INT, COUNT BIGINT>> NOT NULL, unwrapped=false} reason: The 'DELIMITED' format does not support type 'STRUCT' Caused by: The 'DELIMITED' format does not support type 'STRUCT' ```
- Loading branch information
1 parent
7a83bbf
commit 307bf4d
Showing
7 changed files
with
111 additions
and
20 deletions.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
ksql-common/src/main/java/io/confluent/ksql/SchemaNotSupportedException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* | ||
* Copyright 2020 Confluent Inc. | ||
* | ||
* Licensed under the Confluent Community License (the "License"); you may not use | ||
* this file except in compliance with the License. You may obtain a copy of the | ||
* License at | ||
* | ||
* http://www.confluent.io/confluent-community-license | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
* WARRANTIES OF ANY KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations under the License. | ||
*/ | ||
|
||
package io.confluent.ksql; | ||
|
||
import io.confluent.ksql.util.KsqlException; | ||
|
||
/** | ||
* Thrown to indicate the schema is not supported. | ||
*/ | ||
public class SchemaNotSupportedException extends KsqlException { | ||
|
||
public SchemaNotSupportedException(final String message, final Throwable cause) { | ||
super(message, cause); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters