Skip to content

splitgraph.exceptions.UnsupportedSQLError when using Splitfiles #411

@ltrgoddard

Description

@ltrgoddard

I've been enjoying exploring Splitgraph so far—great work! One thing that's bitten me a few times, though, is splitgraph.exceptions.UnsupportedSQLError when attempting to build Splitfiles. Here are a couple of examples using relatively straightforward Postgres syntax for subqueries and array indexing:

FROM splitgraph/congress_tweets:latest IMPORT {
  select
    t.id,
    t.text
  from (select * from tweets) as t
  limit 10
} AS tweets_subquery
FROM splitgraph/congress_tweets:latest IMPORT {
  select
    t.id,
    (string_to_array(t.text, ' '))[1]
  from tweets as t
  limit 10
} AS tweets_array

They throw Unsupported statement type RangeSubselect and Unsupported statement type A_Indirection respectively. This isn't a big problem in this case as the queries can be rewritten relatively simply, but I've found the latter issue to require a hacky workaround when using xpath(), which always returns an XML array, even for scalar values.

It would be helpful to have a reference page in the docs showing exactly which bits of Postgres syntax are not (yet) supported in Splitfiles, to make it easier to assess whether they're the right tool for the job.

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