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

Create simple catalog takes a long time #149

Open
milley23 opened this issue Aug 26, 2023 · 0 comments
Open

Create simple catalog takes a long time #149

milley23 opened this issue Aug 26, 2023 · 0 comments

Comments

@milley23
Copy link

Hi, sorry for asking here. I am using zetasql in my Java Springboot application. When I hit my endpoint that is integrated to zetasql, the duration time is very slow. I checked using newrelic and found that this function need about 9-10s to complete. It affects my endpoint duration time, so I want to optimize it. But, I have any idea how to optimize it. Could anyone please help ?
Thank you.

public static SimpleCatalog createEmptyCatalog() {
    SimpleCatalog catalog = new SimpleCatalog("catalog");

    // Add built-in functions
    catalog.addZetaSQLFunctions(new ZetaSQLBuiltinFunctionOptions());

    // Add BigQuery-specific type aliases
    catalog.addType("INT", TypeFactory.createSimpleType(ZetaSQLType.TypeKind.TYPE_INT64));
    catalog.addType("SMALLINT", TypeFactory.createSimpleType(ZetaSQLType.TypeKind.TYPE_INT64));
    catalog.addType("INTEGER", TypeFactory.createSimpleType(ZetaSQLType.TypeKind.TYPE_INT64));
    catalog.addType("BIGINT", TypeFactory.createSimpleType(ZetaSQLType.TypeKind.TYPE_INT64));
    catalog.addType("TINYINT", TypeFactory.createSimpleType(ZetaSQLType.TypeKind.TYPE_INT64));
    catalog.addType("BYTEINT", TypeFactory.createSimpleType(ZetaSQLType.TypeKind.TYPE_INT64));
    catalog.addType("DECIMAL", TypeFactory.createSimpleType(ZetaSQLType.TypeKind.TYPE_NUMERIC));
    catalog.addType(
        "BIGDECIMAL", TypeFactory.createSimpleType(ZetaSQLType.TypeKind.TYPE_BIGNUMERIC));

    return catalog;
  }
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

No branches or pull requests

1 participant