@@ -72,7 +72,15 @@ public void alterEncodingAndCompressorTest() throws Exception {
7272 statement .execute ("create timeSeries root.vehicle.wind.a int32" );
7373
7474 try {
75- statement .execute ("alter timeSeries root.nonExist.** set encoding=PLAIN" );
75+ statement .execute ("alter timeSeries root set STORAGE_PROPERTIES encoding=PLAIN" );
76+ fail ();
77+ } catch (final SQLException e ) {
78+ Assert .assertEquals ("701: The timeSeries shall not be root." , e .getMessage ());
79+ }
80+
81+ try {
82+ statement .execute (
83+ "alter timeSeries root.nonExist.** set STORAGE_PROPERTIES encoding=PLAIN" );
7684 fail ();
7785 } catch (final SQLException e ) {
7886 Assert .assertEquals (
@@ -81,41 +89,47 @@ public void alterEncodingAndCompressorTest() throws Exception {
8189 }
8290
8391 try {
84- statement .execute ("alter timeSeries if exists root.nonExist.** set encoding=PLAIN" );
92+ statement .execute (
93+ "alter timeSeries if exists root.nonExist.** set STORAGE_PROPERTIES encoding=PLAIN" );
8594 } catch (final SQLException e ) {
8695 fail (
8796 "Alter encoding & compressor shall not fail when timeSeries not exists if set if exists" );
8897 }
8998
9099 try {
91- statement .execute ("alter timeSeries if exists root.vehicle.** set encoding=aaa" );
100+ statement .execute (
101+ "alter timeSeries if exists root.vehicle.** set STORAGE_PROPERTIES encoding=aaa" );
92102 fail ();
93103 } catch (final SQLException e ) {
94104 Assert .assertEquals ("701: Unsupported encoding: AAA" , e .getMessage ());
95105 }
96106
97107 try {
98- statement .execute ("alter timeSeries if exists root.vehicle.** set compressor=aaa" );
108+ statement .execute (
109+ "alter timeSeries if exists root.vehicle.** set STORAGE_PROPERTIES compressor=aaa" );
99110 fail ();
100111 } catch (final SQLException e ) {
101112 Assert .assertEquals ("701: Unsupported compressor: AAA" , e .getMessage ());
102113 }
103114
104115 try {
105- statement .execute ("alter timeSeries if exists root.vehicle.** set falseKey=aaa" );
116+ statement .execute (
117+ "alter timeSeries if exists root.vehicle.** set STORAGE_PROPERTIES falseKey=aaa" );
106118 fail ();
107119 } catch (final SQLException e ) {
108120 Assert .assertEquals ("701: property falsekey is unsupported yet." , e .getMessage ());
109121 }
110122
111123 try {
112- statement .execute ("alter timeSeries if exists root.vehicle.** set encoding=DICTIONARY" );
124+ statement .execute (
125+ "alter timeSeries if exists root.vehicle.** set STORAGE_PROPERTIES encoding=DICTIONARY" );
113126 fail ();
114127 } catch (final SQLException e ) {
115128 Assert .assertTrue (e .getMessage ().contains ("encoding DICTIONARY does not support INT32" ));
116129 }
117130
118- statement .execute ("alter timeSeries root.** set encoding=Plain, compressor=LZMA2" );
131+ statement .execute (
132+ "alter timeSeries root.** set STORAGE_PROPERTIES encoding=Plain, compressor=LZMA2" );
119133
120134 try (final ResultSet resultSet = statement .executeQuery ("SHOW TIMESERIES" )) {
121135 while (resultSet .next ()) {
@@ -133,17 +147,18 @@ public void alterEncodingAndCompressorTest() throws Exception {
133147 EnvFactory .getEnv ().getConnection ("IoTDBUser" , "!@#$!dfdfzvd343" );
134148 final Statement statement = connection .createStatement ()) {
135149 try {
136- statement .execute ("alter timeSeries root.vechile.** set encoding=PLAIN, compressor=LZMA2" );
150+ statement .execute (
151+ "alter timeSeries root.vehicle.** set STORAGE_PROPERTIES encoding=PLAIN, compressor=LZMA2" );
137152 fail ();
138153 } catch (final SQLException e ) {
139154 Assert .assertEquals (
140- "803: No permissions for this operation, please add privilege WRITE_SCHEMA on [root.vechile .**]" ,
155+ "803: No permissions for this operation, please add privilege WRITE_SCHEMA on [root.vehicle .**]" ,
141156 e .getMessage ());
142157 }
143158
144159 try {
145160 statement .execute (
146- "alter timeSeries root.vechile .wind.a, root.__audit.** set encoding=PLAIN, compressor=LZMA2" );
161+ "alter timeSeries root.vehicle .wind.a, root.__audit.** set STORAGE_PROPERTIES encoding=PLAIN, compressor=LZMA2" );
147162 fail ();
148163 } catch (final SQLException e ) {
149164 Assert .assertEquals (
@@ -153,10 +168,17 @@ public void alterEncodingAndCompressorTest() throws Exception {
153168
154169 try {
155170 statement .execute (
156- "alter timeSeries if permitted root.vehicle.**, root.__audit.** set encoding=GORILLA, compressor=GZIP" );
171+ "alter timeSeries if permitted root.vehicle.**, root.__audit.** set STORAGE_PROPERTIES encoding=GORILLA, compressor=GZIP" );
157172 } catch (final SQLException e ) {
158173 fail ("Alter encoding & compressor shall not fail when no privileges if set if permitted" );
159174 }
175+
176+ try {
177+ statement .execute (
178+ "alter timeSeries if permitted root.nonExist.** set STORAGE_PROPERTIES encoding=GORILLA, compressor=GZIP" );
179+ } catch (final SQLException e ) {
180+ fail ("Alter encoding & compressor shall not fail if the intersected paths are empty" );
181+ }
160182 }
161183
162184 try (final Connection connection = EnvFactory .getEnv ().getConnection ();
0 commit comments