Skip to content
Permalink
Browse files
  • Loading branch information
SilverNarcissus committed Oct 16, 2019
2 parents fc97378 + 69d6026 commit c02a58451af1564d9e86c612ad5f109b62d3dd07
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 13 deletions.
@@ -1,4 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->

<fileset-config file-format-version="1.2.0" simple-config="true" sync-formatter="false">
<local-check-config name="google" location="checkstyle.xml" type="project" description="">
6 NOTICE
@@ -10,7 +10,7 @@ IoTDB project uses 4 Chinese Patents:
* 201711384490X
* 201810111712.9
* 201711322631.5
* 201711319331
* 201711319331.1

According to the Apache 2.0 License. The owner of the patents, Tsinghua University,
grant the users the right to the use of patent under the requirement of Apache 2.0 License.
@@ -20,7 +20,7 @@ grant the users the right to the use of patent under the requirement of Apache 2
This product contains a modified portion of 'Apache Hive'

Apache Hive
Copyright 2008-2019 The Apache Software Foundation
Copyright 2008-2018 The Apache Software Foundation

This product includes software developed by The Apache Software
Foundation (http://www.apache.org/).
Foundation (http://www.apache.org/).
@@ -39,9 +39,9 @@
</license>
</licenses>
<scm>
<connection>scm:git:https://github.com/apache/incubator-iotdb.git</connection>
<developerConnection>scm:git:https://github.com/apache/incubator-iotdb.git</developerConnection>
<url>https://github.com/apache/incubator-iotdb</url>
<connection>scm:git:ssh://git@github.com/apache/incubator-iotdb.git</connection>
<developerConnection>scm:git:ssh://git@github.com/apache/incubator-iotdb.git</developerConnection>
<url>ssh://git@github.com:apache/incubator-iotdb.git</url>
<tag>rel/0.8</tag>
</scm>
<modules>
@@ -465,8 +465,6 @@
<exclude>licenses/*</exclude>
<!-- generated by Github -->
<exclude>.github/**</exclude>
<!--Checkstyle files -->
<exclude>.checkstyle</exclude>
<!--Generated by Apache Release -->
<exclude>local-snapshots-dir/**</exclude>
<!-- JSON can't contain comments and therefore no Apache header -->
@@ -57,7 +57,6 @@
import org.apache.iotdb.db.sql.parse.AstNode;
import org.apache.iotdb.db.sql.parse.Node;
import org.apache.iotdb.db.sql.parse.TSParser;
import org.apache.iotdb.tsfile.common.conf.TSFileConfig;
import org.apache.iotdb.tsfile.common.conf.TSFileDescriptor;
import org.apache.iotdb.tsfile.common.constant.TsFileConstant;
import org.apache.iotdb.tsfile.file.metadata.enums.CompressionType;
@@ -392,16 +391,16 @@ private void analyzePropertyUnLink(AstNode astNode) {
private void analyzeMetadataCreate(AstNode astNode) throws MetadataErrorException {
Path series = parsePath(astNode.getChild(0).getChild(0));
AstNode paramNode = astNode.getChild(1);
String dataType = paramNode.getChild(0).getChild(0).getText();
String encodingType = paramNode.getChild(1).getChild(0).getText();
String dataType = paramNode.getChild(0).getChild(0).getText().toUpperCase();
String encodingType = paramNode.getChild(1).getChild(0).getText().toUpperCase();
String compressor;
int offset = 2;
if (paramNode.getChildren().size() > offset
&& paramNode.getChild(offset).getToken().getText().equals("TOK_COMPRESSOR")) {
compressor = paramNode.getChild(offset).getChild(0).getText();
compressor = paramNode.getChild(offset).getChild(0).getText().toUpperCase();
offset++;
} else {
compressor = TSFileDescriptor.getInstance().getConfig().getCompressor();
compressor = TSFileDescriptor.getInstance().getConfig().getCompressor().toUpperCase();
}
checkMetadataArgs(dataType, encodingType, compressor);
Map<String, String> props = new HashMap<>(paramNode.getChildCount() - offset + 1, 1);
@@ -94,6 +94,16 @@ public void testMetadata()
"encoding: RLE%nnamespace type: ADD_PATH%n" + "args: "), plan.toString());
}

@Test
public void testMetadata2()
throws QueryProcessorException, ArgsErrorException, MetadataErrorException {
String metadata = "create timeseries root.vehicle.d1.s2 with datatype=int32,encoding=rle";
QueryProcessor processor = new QueryProcessor(new MemIntQpExecutor());
MetadataPlan plan = (MetadataPlan) processor.parseSQLToPhysicalPlan(metadata);
assertEquals(String.format("seriesPath: root.vehicle.d1.s2%n" + "resultDataType: INT32%n" +
"encoding: RLE%nnamespace type: ADD_PATH%n" + "args: "), plan.toString());
}

@Test
public void testAuthor()
throws QueryProcessorException, ArgsErrorException, MetadataErrorException {

0 comments on commit c02a584

Please sign in to comment.