From eeda1948aa523dece18fc1fc5c37563c10824419 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BB=B4=E7=AB=A0?= Date: Thu, 22 Sep 2022 14:37:32 +0800 Subject: [PATCH 1/2] fix(parser) fix npe --- rsqldb-disk/conf/rsqldb.conf | 6 ++++-- .../rsqldb/parser/parser/function/HopParser.java | 15 +++++++++------ 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/rsqldb-disk/conf/rsqldb.conf b/rsqldb-disk/conf/rsqldb.conf index bff3d34..bf2d6b1 100644 --- a/rsqldb-disk/conf/rsqldb.conf +++ b/rsqldb-disk/conf/rsqldb.conf @@ -1,4 +1,6 @@ +#RocketMQ集群中namesrv地址 NAMESRV_ADDR=127.0.0.1:9876 +#流处理任务命名空间 namespace=test ## 流计算经过任务解析器(rsqldb-server)解析后保存位置,可以是memory, DB 或者file @@ -12,8 +14,8 @@ jdbc.password= ## 窗口配置 #group by 时窗口大小,单位s,sql中不配置或者这里不指定的话默认600s -dipper.window.default.iterval.size.time=10 +window.default.iterval.size.time=10 #client产生的流计算任务位置,目前需要填绝对路径,client生成后,runner从该位置读取流计算任务。配置形式为: #filePathAndName=/Users/rsqldb/rsqldb-disk/server/rsqldb.cs -filePathAndName=/Users/nize/code/github/rsqldb/rsqldb-disk/server/rsqldb.cs +filePathAndName= diff --git a/rsqldb-parser/src/main/java/com/alibaba/rsqldb/parser/parser/function/HopParser.java b/rsqldb-parser/src/main/java/com/alibaba/rsqldb/parser/parser/function/HopParser.java index bbdf294..a3373df 100644 --- a/rsqldb-parser/src/main/java/com/alibaba/rsqldb/parser/parser/function/HopParser.java +++ b/rsqldb-parser/src/main/java/com/alibaba/rsqldb/parser/parser/function/HopParser.java @@ -48,13 +48,16 @@ public static com.alibaba.rsqldb.parser.parser.builder.WindowBuilder createWindo com.alibaba.rsqldb.parser.parser.builder.WindowBuilder windowBuilder = new com.alibaba.rsqldb.parser.parser.builder.WindowBuilder(); SqlWatermark sqlWatermark = ThreadLocalUtil.watermarkHolder.get().get(builder.getSourceTable()); - int watermarkOffset; - try { - watermarkOffset = (int)sqlWatermark.getWatermarkOffset(); - } catch (Throwable e) { - throw new RuntimeException(e); + + if (sqlWatermark !=null) { + int watermarkOffset; + try { + watermarkOffset = (int)sqlWatermark.getWatermarkOffset(); + } catch (Throwable e) { + throw new RuntimeException(e); + } + windowBuilder.setWatermark(watermarkOffset); } - windowBuilder.setWatermark(watermarkOffset); windowBuilder.setType(IWindow.HOP_WINDOW); windowBuilder.setOwner(builder); From 889e568cf5337839560e7a60ea11903fd56dce33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BB=B4=E7=AB=A0?= Date: Thu, 22 Sep 2022 14:40:00 +0800 Subject: [PATCH 2/2] fix(parser) modify default configurtion --- rsqldb-disk/conf/rsqldb.conf | 4 ++-- .../com/alibaba/rsqldb/parser/parser/function/HopParser.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/rsqldb-disk/conf/rsqldb.conf b/rsqldb-disk/conf/rsqldb.conf index bf2d6b1..03ee644 100644 --- a/rsqldb-disk/conf/rsqldb.conf +++ b/rsqldb-disk/conf/rsqldb.conf @@ -13,8 +13,8 @@ jdbc.password= ## 窗口配置 -#group by 时窗口大小,单位s,sql中不配置或者这里不指定的话默认600s -window.default.iterval.size.time=10 +#group by 时窗口大小,单位s,默认为10s +window.default.iterval.size.time= #client产生的流计算任务位置,目前需要填绝对路径,client生成后,runner从该位置读取流计算任务。配置形式为: #filePathAndName=/Users/rsqldb/rsqldb-disk/server/rsqldb.cs diff --git a/rsqldb-parser/src/main/java/com/alibaba/rsqldb/parser/parser/function/HopParser.java b/rsqldb-parser/src/main/java/com/alibaba/rsqldb/parser/parser/function/HopParser.java index a3373df..1053efe 100644 --- a/rsqldb-parser/src/main/java/com/alibaba/rsqldb/parser/parser/function/HopParser.java +++ b/rsqldb-parser/src/main/java/com/alibaba/rsqldb/parser/parser/function/HopParser.java @@ -44,7 +44,7 @@ public static com.alibaba.rsqldb.parser.parser.builder.WindowBuilder createWindo /** * 如果只有group by,没有指定窗口,则通过配置获取默认窗口大小,如果未指定,默认1个小时 */ - int interval = WindowBuilder.getIntValue(ConfigureFileKey.DIPPER_WINDOW_DEFAULT_INERVAL_SIZE, 60 * 10); + int interval = WindowBuilder.getIntValue(ConfigureFileKey.DIPPER_WINDOW_DEFAULT_INERVAL_SIZE, 10); com.alibaba.rsqldb.parser.parser.builder.WindowBuilder windowBuilder = new com.alibaba.rsqldb.parser.parser.builder.WindowBuilder(); SqlWatermark sqlWatermark = ThreadLocalUtil.watermarkHolder.get().get(builder.getSourceTable());