[INLONG-10130][SDK] Transform SQL support string concat function #10143
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #10130
Motivation
Transform SQL support string concat function
Modifications
Support to parse the following PB protocol
syntax = "proto3";
package test;
message SdkMessage {
bytes msg = 1;
int64 msgTime = 2;
map<string, string> extinfo = 3;
}
message SdkDataRequest {
string sid = 1;
repeated SdkMessage msgs = 2;
uint64 packageID = 3;
}
Support to parse the following PB data
SdkDataRequest.Builder requestBuilder = SdkDataRequest.newBuilder();
requestBuilder.setSid("sid");
requestBuilder.setPackageID(1);
{
SdkMessage.Builder msgBuilder = SdkMessage.newBuilder();
msgBuilder.setMsgTime(1713243918000L);
msgBuilder.setMsg(ByteString.copyFrom("msgValue4".getBytes()));
msgBuilder.putExtinfo("key", "value");
SdkMessage msgObj = msgBuilder.build();
requestBuilder.addMsgs(msgObj);
}
{
SdkMessage.Builder msgBuilder = SdkMessage.newBuilder();
msgBuilder.setMsgTime(1713243918002L);
msgBuilder.setMsg(ByteString.copyFrom("msgValue42".getBytes()));
msgBuilder.putExtinfo("key2", "value2");
SdkMessage msgObj = msgBuilder.build();
requestBuilder.addMsgs(msgObj);
}
SdkDataRequest requestObj = requestBuilder.build();
byte[] srcBytes = requestObj.toByteArray();
Generate the final data by the following SQL
select $root.sid,$root.packageID,$child.msgTime,concat($root.sid,$root.packageID,$child.msgTime,$child.msg) msg from source
The final data is the following string
sid|1|1713243918000|sid11713243918000msgValue4
sid|1|1713243918002|sid11713243918002msgValue42
Verifying this change
(Please pick either of the following options)
This change is a trivial rework/code cleanup without any test coverage.
This change is already covered by existing tests, such as:
(please describe tests)
This change added tests and can be verified as follows:
(example:)
Documentation