cjj2010 commented on code in PR #4756:
URL: https://github.com/apache/calcite/pull/4756#discussion_r2710806495
##########
redis/src/main/java/org/apache/calcite/adapter/redis/RedisSchema.java:
##########
@@ -86,10 +87,15 @@ public RedisTableFieldInfo getTableFieldInfo(String
tableName) {
if (jsonCustomTable.name.equals(tableName)) {
Map<String, Object> map =
requireNonNull(jsonCustomTable.operand, "operand");
- if (map.get("dataFormat") == null) {
+ if (ObjectUtils.isEmpty(map.get("dataFormat"))) {
Review Comment:
> This class contains some hard-coded variables, such as `dataFormat`,
`fields`, and `keyDelimiter`. It is recommended to modify these to final
constants for easier maintenance by future developers.
Thank you for your suggestion, it has been fixed
##########
redis/src/main/java/org/apache/calcite/adapter/redis/RedisSchema.java:
##########
@@ -86,10 +87,15 @@ public RedisTableFieldInfo getTableFieldInfo(String
tableName) {
if (jsonCustomTable.name.equals(tableName)) {
Map<String, Object> map =
requireNonNull(jsonCustomTable.operand, "operand");
- if (map.get("dataFormat") == null) {
+ if (ObjectUtils.isEmpty(map.get("dataFormat"))) {
throw new RuntimeException("dataFormat is null");
Review Comment:
> Exception messages should be consistent and clear. It's recommended to
keep them the same as the messages below(line 94), for example: "dataFormat is
null, it must be raw, csv, or json".
done
--
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]