Skip to content

Parse schema in queries #15

Open
Open

Description

@vdichev

Currently using a schema to qualify the table name e.g. "SELECT * FROM schema.table" doesn't work. The parser is actually the easy part, if I just parse and ignore the schema, I get an error message of the kind "Unknown table XXX". It seems that this is because only data about the current schema is being loaded. If this is the case, what strategies might be used to get all relevant schemas? All? Lazily load the schema on first encounter? Configure schemas to load in a config file?

Activity

  1. jonifreeman commented on Apr 5, 2016

    @jonifreeman
    Owner

    Reading all schemas is probably not practical as it is a relatively expensive operation (I once had almost 100 schemas in my db). Lazy loading as needed would be very nice in my opinion as configuration options often tend to complicate stuff from user's point of view.

  2. vdichev commented on Jul 20, 2016

    @vdichev
    CollaboratorAuthor

    Just wondering, why is the schema cache implemented using a WeakHashMap? The entries cannot be reused between context runs anyway, and within a run a schema seems to be produced only once. Is there something I'm missing here? This is something I'm considering for the implementation of extending the schema with different schema names in addition to the default one.

  3. jonifreeman commented on Jul 31, 2016

    @jonifreeman
    Owner

    Not sure if WeakHashMap is needed. I initially used it to avoid leaking problem raised by Eugene Burmako here: http://grokbase.com/t/gg/scala-user/129r18wjgv/macros-and-caching

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions