You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by GitBox <gi...@apache.org> on 2022/05/25 08:22:36 UTC
[GitHub] [iotdb] MarcosZyk commented on a diff in pull request #6013: [IOTDB-3290] modify check logic of CreateTimeSeries
MarcosZyk commented on code in PR #6013:
URL: https://github.com/apache/iotdb/pull/6013#discussion_r881364628
##########
server/src/main/java/org/apache/iotdb/db/mpp/plan/analyze/Analyzer.java:
##########
@@ -887,16 +887,18 @@ public Analysis visitCreateTimeseries(
private void checkProps(CreateTimeSeriesStatement createTimeSeriesStatement) {
Map<String, String> props = createTimeSeriesStatement.getProps();
- if (!props.containsKey(IoTDBConstant.COLUMN_TIMESERIES_DATATYPE.toLowerCase())) {
- throw new SemanticException("datatype must be declared");
+ if (props.containsKey(IoTDBConstant.COLUMN_TIMESERIES_DATATYPE.toLowerCase())) {
+ String datatypeString =
+ props.get(IoTDBConstant.COLUMN_TIMESERIES_DATATYPE.toLowerCase()).toUpperCase();
+ try {
+ createTimeSeriesStatement.setDataType(TSDataType.valueOf(datatypeString));
+ props.remove(IoTDBConstant.COLUMN_TIMESERIES_DATATYPE.toLowerCase());
+ } catch (Exception e) {
+ throw new SemanticException(String.format("Unsupported datatype: %s", datatypeString));
Review Comment:
Does this means the message of props is put in to the dataType?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org