Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
apache
pulsar
提交
745f7d02
pulsar
项目概览
apache
/
pulsar
通知
129
Star
40
Fork
3
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Wiki
1
Wiki
分析
仓库
DevOps
项目成员
Pages
pulsar
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Pages
分析
分析
仓库分析
DevOps
Wiki
1
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
提交
体验新版 GitCode,发现更多精彩内容 >>
提交
745f7d02
编写于
2月 25, 2019
作者:
B
Boyang Jerry Peng
提交者:
Matteo Merli
3月 29, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: non-batched messages cause sql query to fail (#3684)
上级
3a3966cb
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
12 addition
and
3 deletion
+12
-3
pulsar-common/src/main/java/org/apache/pulsar/common/api/raw/MessageParser.java
.../java/org/apache/pulsar/common/api/raw/MessageParser.java
+1
-1
tests/integration/src/test/java/org/apache/pulsar/tests/integration/presto/TestBasicPresto.java
...ache/pulsar/tests/integration/presto/TestBasicPresto.java
+11
-2
未找到文件。
pulsar-common/src/main/java/org/apache/pulsar/common/api/raw/MessageParser.java
浏览文件 @
745f7d02
...
...
@@ -86,7 +86,7 @@ public class MessageParser {
if
(
numMessages
==
1
&&
!
msgMetadata
.
hasNumMessagesInBatch
())
{
processor
.
process
(
RawMessageImpl
.
get
(
refCntMsgMetadata
,
null
,
uncompressedPayload
,
ledgerId
,
entryId
,
0
));
RawMessageImpl
.
get
(
refCntMsgMetadata
,
null
,
uncompressedPayload
.
retain
()
,
ledgerId
,
entryId
,
0
));
}
else
{
// handle batch message enqueuing; uncompressed payload has all messages in batch
receiveIndividualMessagesFromBatch
(
refCntMsgMetadata
,
uncompressedPayload
,
ledgerId
,
entryId
,
processor
);
...
...
tests/integration/src/test/java/org/apache/pulsar/tests/integration/presto/TestBasicPresto.java
浏览文件 @
745f7d02
...
...
@@ -67,7 +67,16 @@ public class TestBasicPresto extends PulsarTestSuite {
}
@Test
public
void
testSimpleSQLQuery
()
throws
Exception
{
public
void
testSimpleSQLQueryBatched
()
throws
Exception
{
testSimpleSQLQuery
(
true
);
}
@Test
public
void
testSimpleSQLQueryNonBatched
()
throws
Exception
{
testSimpleSQLQuery
(
false
);
}
public
void
testSimpleSQLQuery
(
boolean
isBatched
)
throws
Exception
{
@Cleanup
PulsarClient
pulsarClient
=
PulsarClient
.
builder
()
...
...
@@ -79,9 +88,9 @@ public class TestBasicPresto extends PulsarTestSuite {
@Cleanup
Producer
<
Stock
>
producer
=
pulsarClient
.
newProducer
(
JSONSchema
.
of
(
Stock
.
class
))
.
topic
(
stocksTopic
)
.
enableBatching
(
isBatched
)
.
create
();
for
(
int
i
=
0
;
i
<
NUM_OF_STOCKS
;
++
i
)
{
final
Stock
stock
=
new
Stock
(
i
,
"STOCK_"
+
i
,
100.0
+
i
*
10
);
producer
.
send
(
stock
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录