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

Parse schema in queries #15

Open
vdichev opened this issue Apr 5, 2016 · 3 comments
Open

Parse schema in queries #15

vdichev opened this issue Apr 5, 2016 · 3 comments

Comments

@vdichev
Copy link
Collaborator

vdichev commented Apr 5, 2016

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?

@jonifreeman
Copy link
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.

@vdichev
Copy link
Collaborator Author

vdichev commented Jul 20, 2016

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.

@jonifreeman
Copy link
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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants