Skip to content

Create simple catalog takes a long time #149

@milley23

Description

@milley23

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions