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

Show debug output for avro schemas during dry run #84

Merged

Conversation

chuck-alt-delete
Copy link
Collaborator

@chuck-alt-delete chuck-alt-delete commented Mar 20, 2023

What type of PR is this? (check all applicable)

  • ♻️ Refactor
  • ✨ Feature
  • 🐛 Bug Fix
  • 👷 Optimization
  • 📝 Documentation Update
  • 🚩 Other

Description

We lost the ability to see output avro schema when debugging a dry run. This happened because creating an instance of the AvroFormat class requires creating a schema registry client (which shouldn't happen on dry run). However, we don't actually need to create a schema registry client in order to see the what avro schemas would be produced with --format avro. All that is needed is one instance of a "megaRecord". We then use the @types/avro library to generate avro schema from the record.

To bring back this functionality of debugging output avro schema for a dry run, I made the getAvroSchemas(megaRecord) method static and call it during dry run on the first iteration in dataGenerator.

Added to documentation?

  • 📜 readme
  • 🙅 no documentation needed

src/dataGenerator.ts Show resolved Hide resolved
src/dataGenerator.ts Outdated Show resolved Hide resolved
@chuck-alt-delete chuck-alt-delete merged commit 843b30a into MaterializeInc:main Mar 20, 2023
@chuck-alt-delete chuck-alt-delete deleted the add-avro-schema-to-debug branch March 20, 2023 21:56
recursethis pushed a commit to recursethis/materialize-datagen that referenced this pull request Feb 26, 2024
…lizeInc#84)

* make debug output for avro schemas even during dry run

* remove unneeded whitespace
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