Skip to content

YQ-3738 Fix metafields in read_actor / to stable #12725

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -797,7 +797,7 @@ void TDqPqRdReadActor::AddMessageBatch(TRope&& messageBatch, NKikimr::NMiniKQL::
*(itemPtr++) = parsedRow[*index];
} else {
// TODO: support metadata fields here
*(itemPtr++) = NUdf::TUnboxedValue();
*(itemPtr++) = NUdf::TUnboxedValuePod::Zero();
}
}

Expand Down
30 changes: 29 additions & 1 deletion ydb/tests/fq/yds/test_row_dispatcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ def test_simple_not_null(self, kikimr, client):

query_id = start_yds_query(kikimr, client, sql)
wait_actor_count(kikimr, "FQ_ROW_DISPATCHER_SESSION", 1)
time.sleep(10)

data = [
'{"time": 101, "data": "hello1", "event": "event1"}',
Expand All @@ -167,6 +166,35 @@ def test_simple_not_null(self, kikimr, client):
assert len(read_rules) == 0, read_rules
wait_actor_count(kikimr, "FQ_ROW_DISPATCHER_SESSION", 0)

@yq_v1
def test_metadatafields(self, kikimr, client):
client.create_yds_connection(
YDS_CONNECTION, os.getenv("YDB_DATABASE"), os.getenv("YDB_ENDPOINT"), shared_reading=True
)
self.init_topics("test_metadatafields")

# Its not completely clear why metadatafields appear in this request(
sql = Rf'''
PRAGMA FeatureR010="prototype";
PRAGMA config.flags("TimeOrderRecoverDelay", "-10");
PRAGMA config.flags("TimeOrderRecoverAhead", "10");
INSERT INTO {YDS_CONNECTION}.`{self.output_topic}`
SELECT ToBytes(Unwrap(Json::SerializeJson(Yson::From(TableRow())))) FROM {YDS_CONNECTION}.`{self.input_topic}`
WITH (format=json_each_row, SCHEMA (time Int32 NOT NULL))
MATCH_RECOGNIZE(
ORDER BY CAST(time as Timestamp)
MEASURES LAST(A.time) as b_key
PATTERN (A )
DEFINE A as A.time > 4
);'''

query_id = start_yds_query(kikimr, client, sql)
wait_actor_count(kikimr, "FQ_ROW_DISPATCHER_SESSION", 1)

self.write_stream(['{"time": 100}', '{"time": 120}'])
assert len(self.read_stream(1, topic_path=self.output_topic)) == 1
stop_yds_query(client, query_id)

@yq_v1
def test_simple_optional(self, kikimr, client):
client.create_yds_connection(
Expand Down
Loading