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

Metabase SQL API Error (Unsupported format specifier %s) #9126

Closed
itestyoy opened this issue Jan 22, 2025 · 2 comments · Fixed by #9129
Closed

Metabase SQL API Error (Unsupported format specifier %s) #9126

itestyoy opened this issue Jan 22, 2025 · 2 comments · Fixed by #9129
Assignees
Labels
api:sql Issues related to SQL API tool:metabase

Comments

@itestyoy
Copy link

Hi! We tested Cube 1.1.16 to address the error with Metabase (#9072). However, we’re now encountering a new error, as shown below.

It’s very important for us to update Metabase to the latest version, and we’ve been waiting for this release to resolve the previous issue.

Could you please assist us in resolving this new error?

Error during processing PostgreSQL message: CubeError: Arrow error: External error: Execution error: Unsupported format specifier %s
select
    "c"."column_name" as "name",
    case
        when "c"."udt_schema" in ('public', 'pg_catalog')
        then format('%s', "c"."udt_name")
        else format('"%s"."%s"', "c"."udt_schema", "c"."udt_name")
    end as "database-type",
    "c"."ordinal_position" - 1 as "database-position",
    "c"."table_schema" as "table-schema",
    "c"."table_name" as "table-name",
    "pk"."column_name" is not null as "pk?",
    col_description(
        cast(
            cast(
                format(
                    '%I.%I',
                    cast("c"."table_schema" as text),
                    cast("c"."table_name" as text)
                ) as regclass
            ) as oid
        ),
        "c"."ordinal_position"
    ) as "field-comment",
    (("column_default" is null) or (lower("column_default") = 'null'))
    and ("is_nullable" = 'NO')
    and not (
        (("column_default" is not null) and ("column_default" like '%nextval(%'))
        or ("is_identity" <> 'NO')
    ) as "database-required",
    (("column_default" is not null) and ("column_default" like '%nextval(%'))
    or ("is_identity" <> 'NO') as "database-is-auto-increment"
from "information_schema"."columns" as "c"
left join
    (
        select "tc"."table_schema", "tc"."table_name", "kc"."column_name"
        from "information_schema"."table_constraints" as "tc"
        inner join
            "information_schema"."key_column_usage" as "kc"
            on ("tc"."constraint_name" = "kc"."constraint_name")
            and ("tc"."table_schema" = "kc"."table_schema")
            and ("tc"."table_name" = "kc"."table_name")
        where "tc"."constraint_type" = 'PRIMARY KEY'
    ) as "pk"
    on ("c"."table_schema" = "pk"."table_schema")
    and ("c"."table_name" = "pk"."table_name")
    and ("c"."column_name" = "pk"."column_name")
where
    c.table_schema !~ '^information_schema|catalog_history|pg_'
    and ("c"."table_schema" in ($1))
union all
select
    "pa"."attname" as "name",
    case
        when "ptn"."nspname" in ('public', 'pg_catalog')
        then format('%s', "pt"."typname")
        else format('"%s"."%s"', "ptn"."nspname", "pt"."typname")
    end as "database-type",
    "pa"."attnum" - 1 as "database-position",
    "pn"."nspname" as "table-schema",
    "pc"."relname" as "table-name",
    false as "pk?",
    null as "field-comment",
    false as "database-required",
    false as "database-is-auto-increment"
from "pg_catalog"."pg_class" as "pc"
inner join "pg_catalog"."pg_namespace" as "pn" on "pn"."oid" = "pc"."relnamespace"
inner join "pg_catalog"."pg_attribute" as "pa" on "pa"."attrelid" = "pc"."oid"
inner join "pg_catalog"."pg_type" as "pt" on "pt"."oid" = "pa"."atttypid"
inner join "pg_catalog"."pg_namespace" as "ptn" on "ptn"."oid" = "pt"."typnamespace"
where ("pc"."relkind" = 'm') and ("pa"."attnum" >= 1) and ("pn"."nspname" in ($2))
order by "table-schema" asc, "table-name" asc, "database-position" asc
@itestyoy itestyoy added the api:sql Issues related to SQL API label Jan 22, 2025
@mcheshkov mcheshkov self-assigned this Jan 22, 2025
mcheshkov added a commit that referenced this issue Jan 23, 2025
Used by Metabase introspection
See metabase/metabase#50900

Fixes #9126
mcheshkov added a commit that referenced this issue Jan 23, 2025
Used by Metabase introspection
See metabase/metabase#50900

Fixes #9126
mcheshkov added a commit that referenced this issue Jan 23, 2025
Used by Metabase introspection
See metabase/metabase#50900

Fixes #9126
@igorlukanin
Copy link
Member

@itestyoy The fix was released in v1.1.17. Please check it out.

@itestyoy
Copy link
Author

I’ve checked it, and everything is working fine. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api:sql Issues related to SQL API tool:metabase
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants