Giter VIP home page Giter VIP logo

Comments (8)

acmiyaguchi avatar acmiyaguchi commented on August 20, 2024

This is another backwards incompatible change, we should be prepared to drop data at the end of it. Here is where we currently modify properties to satisfy BigQuery column naming:

/// Renames a column name so it contains only letters, numbers, and
/// underscores while starting with a letter or underscore. This requirement
/// is enforced by BigQuery during table creation.
fn rename_string_bigquery(string: &str) -> Option<String> {
let re = Regex::new(r"^[a-zA-Z_][a-zA-Z0-9_]*$").unwrap();
let mut renamed = string.replace(".", "_").replace("-", "_");
if renamed.chars().next().unwrap().is_numeric() {
renamed = format!("_{}", renamed);
};
if re.is_match(&renamed) {
Some(renamed)
} else {
None
}
}

from jsonschema-transpiler.

jklukas avatar jklukas commented on August 20, 2024

This is another backwards incompatible change, we should be prepared to drop data at the end of it.

Yes, I want to roll together any remaining disruptive changes in the next few weeks so that we can deploy reliable prod stacks. In particular, I'd love to roll this together with deploying a final main ping schema representation.

from jsonschema-transpiler.

relud avatar relud commented on August 20, 2024

in direct2parquet we did snake case partially because of the issues with camel case described here: https://docs.aws.amazon.com/athena/latest/ug/tables-databases-columns-names.html

from jsonschema-transpiler.

jklukas avatar jklukas commented on August 20, 2024

We discussed this in the data platform team meeting today, and there was a question as to where this should happen in the pipeline. The choices are:

  1. Transform in the Decoder immediately after validating the payload using the JSON schema, meaning that the decoded streams in PubSub also have snake_case normalized payloads
  2. Transform in the BigQuery sink
  3. Transform in BigQuery via a view generated from the schema

I worry that trying to handle this in a BigQuery view won't be tenable. It's potentially a very large amount of query text for the view, which could introduce performance issues.

from jsonschema-transpiler.

relud avatar relud commented on August 20, 2024

I worry that trying to handle this in a BigQuery view won't be tenable. It's potentially a very large amount of query text for the view, which could introduce performance issues.

that could also be an issue with bigquery query size quota:

  • Maximum unresolved standard SQL query length — 1 MB

  • Maximum resolved legacy and standard SQL query length — 12 MB

    The limit on resolved query length includes the length of all views and wildcard tables referenced by the query.

from jsonschema-transpiler.

jklukas avatar jklukas commented on August 20, 2024

See proposal document: https://docs.google.com/document/d/1lY0yGiC8Okx0eJAzI_Pik3-kW4CgNBN2OhMLHlM_uLQ/edit

from jsonschema-transpiler.

jklukas avatar jklukas commented on August 20, 2024

The snake casing document is closing today. After some refactoring about where we apply snake casing, we are still planning to use snake case in BQ, so this change is needed.

from jsonschema-transpiler.

jklukas avatar jklukas commented on August 20, 2024

@acmiyaguchi is going to work on this early next week.

from jsonschema-transpiler.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.