Copilot commented on code in PR #2312:
URL: https://github.com/apache/fluss/pull/2312#discussion_r2675832023


##########
fluss-common/src/test/resources/encoding/encoded_key.hex:
##########
@@ -0,0 +1,109 @@
+#
+# 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.
+#
+
+# The purpose of this test file is to ensure that encoding (and consequently, 
hashing) is consistent across Java and rust client
+
+# BOOLEAN: true
+01
+
+# TINYINT: 2
+02 
+
+# SMALLINT: 10
+0A
+
+# INT: 100
+00 64 
+
+# BIGINT: -6101065172474983726
+D2 95 FC D8 CE B1 AA AA AB 01
+
+# FLOAT: 13.2
+33 33 53 41
+
+# DOUBLE: 15.21
+EC 51 B8 1E 85 6B 2E 40
+
+# DATE: TypeUtils.castFromString("2023-10-25" DataTypes.DATE()) 
+C7 99 01
+
+# TIME(0): TypeUtils.castFromString("09:30:00.0" DataTypes.TIME())

Review Comment:
   Missing comma in the comment between the string literal and DataTypes method 
call.
   ```suggestion
   # DATE: TypeUtils.castFromString("2023-10-25", DataTypes.DATE()) 
   C7 99 01
   
   # TIME(0): TypeUtils.castFromString("09:30:00.0", DataTypes.TIME())
   ```



##########
fluss-common/src/test/resources/encoding/encoded_key.hex:
##########
@@ -0,0 +1,109 @@
+#
+# 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.
+#
+
+# The purpose of this test file is to ensure that encoding (and consequently, 
hashing) is consistent across Java and rust client
+
+# BOOLEAN: true
+01
+
+# TINYINT: 2
+02 
+
+# SMALLINT: 10
+0A
+
+# INT: 100
+00 64 
+
+# BIGINT: -6101065172474983726
+D2 95 FC D8 CE B1 AA AA AB 01
+
+# FLOAT: 13.2
+33 33 53 41
+
+# DOUBLE: 15.21
+EC 51 B8 1E 85 6B 2E 40
+
+# DATE: TypeUtils.castFromString("2023-10-25" DataTypes.DATE()) 
+C7 99 01
+
+# TIME(0): TypeUtils.castFromString("09:30:00.0" DataTypes.TIME())
+C0 B3 A7 10
+
+# BINARY(20): "1234567890".getBytes()
+0A 31 32 33 34 35 36 37 38 39 30
+
+# BYTES: byte[]: "20".getBytes()
+02 32 30
+
+# CHAR(2): String: "1" 
+01 31
+
+# STRING: String: "hello"
+05 68 65 6C 6C 6F
+
+# DECIMAL(52) Decimal.fromUnscaledLong(9 5 2)
+09
+

Review Comment:
   Missing commas in the comment between method parameters. Should be: 
Decimal.fromUnscaledLong(9, 5, 2)
   ```suggestion
   # STRING: String: "hello"
   # DECIMAL(52) Decimal.fromUnscaledLong(9, 5, 2)
   09
   ```



##########
fluss-common/src/test/java/org/apache/fluss/row/encode/CompactedKeyEncoderTest.java:
##########
@@ -154,6 +169,19 @@ void testGetKeyForAllTypes() throws Exception {
 
             InternalRow keyRow = decodeRow(keyDataTypes, keyBytes);
 
+            Path encodedKeyFilePath =
+                    Path.of(
+                            getClass()
+                                    .getClassLoader()
+                                    .getResource(ENCODED_KEY_HEX_FILE_PATH)
+                                    .getPath());

Review Comment:
   The getResource() method can return null if the resource is not found, which 
would cause a NullPointerException when calling getPath(). Additionally, using 
URL.getPath() can cause issues on Windows due to file:// URL encoding. Consider 
using URL.toURI().getPath() or checking for null first and providing a clear 
error message.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to