Skip to content
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

Add option to initialize decode_avro resource, so that compiled avro schema could be reused #628

Merged
merged 2 commits into from Dec 4, 2019

Conversation

yongtang
Copy link
Member

This PR add a decode_avro_init which returns a resource handle with compiled avro schema.

The resource handle could then be passed to decode_avro multiple times, thus avoiding recompile of avro schema.

Note decode_avro could accept both a string (schema) or a resource handle. If a string is passed, the recompile of schema will be done in place within the kernel ops of decode_avro. This PR is backward-compatible.

This PR is part of the effort for issue #611.

Signed-off-by: Yong Tang yong.tang.github@outlook.com

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
…schema could be reused

This PR add a decode_avro_init which returns a resource handle
with compiled avro schema.

The resource handle could then be passed to decode_avro multiple times,
thus avoiding recompile of avro schema.

Note decode_avro could accept both a string (schema) or a resource handle.
If a string is passed, the recompile of schema will be done in place
within the kernel ops of decode_avro. This PR is backward-compatible.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
@yongtang
Copy link
Member Author

/cc @kaiwaehner @sbaier1, this PR is also related to the optimization for KafkaDataset (issue #611).

@yongtang yongtang mentioned this pull request Nov 12, 2019
4 tasks
@terrytangyuan terrytangyuan merged commit 3df2699 into tensorflow:master Dec 4, 2019
i-ony pushed a commit to i-ony/io that referenced this pull request Feb 8, 2021
…schema could be reused (tensorflow#628)

* Convert decode_avro's schema as tensor (vs. attr)

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>

* Add option to initialize decode_avro resource, so that compiled avro schema could be reused

This PR add a decode_avro_init which returns a resource handle
with compiled avro schema.

The resource handle could then be passed to decode_avro multiple times,
thus avoiding recompile of avro schema.

Note decode_avro could accept both a string (schema) or a resource handle.
If a string is passed, the recompile of schema will be done in place
within the kernel ops of decode_avro. This PR is backward-compatible.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants