Closed o1lo01ol1o closed 4 years ago
5 seconds is the timeout used by the UI thread to process schemas at compile time (as opposed to runtime). If your schema takes longer than 5 seconds to import, then the UI thread will show an error in the UI, but it shouldn’t timeout at runtime. You should be able to test this by toggling the ‘prove’ option in the UI. On further reflection, 'jdbc schema import all' should probably not even be attempted at compile time, since jdbc fetches over the internet can easily exceed 5 seconds. I’ll make that change.
Alternatively, it wouldn’t surprise me if some internal error due to Postgres and CQL interaction is escaping and manifesting as a 5 second timeout, as the UI does ‘last resort’ error catching. Postgres testing is lacking compared to e.g., H2 or MySQL. Can you share your file and/or data?
Finally, the reason schema import can take longer than 5 seconds is that the schema ‘import all’ constructs a decision procedure for the SQL schema naively, rather than exploiting the particular nature of SQL primary and foreign keys, etc. The reason for that is mostly expediency: in practice, importing a slice of SQL data onto explicitly designed CQL schemas tends to work far better than importing everything into CQL and then projecting the slice you care about from within CQL. In particular, this landing process can be used to create fresh IDs, normalize values, perform type conversion, etc from within SQL code, and it bypasses the construction of a decision procedure for the entire sql database schema.
On Jul 9, 2020, at 2:24 AM, Tim Pierson notifications@github.com wrote:
I have a large schema in postgres I'm trying to import but seem to be unable to set the timeout option. The entirety of my CQL file is:
options timeout = 6000 gui_rows_to_display = 600 gui_max_table_size = 6000 gui_max_graph_size = 6000 gui_max_string_size = 6000 always_reload = true
schema sourcedata = import_jdbc_all "jdbc:postgresql://foo/bar" This seems to always throw:
Timeout after 5 seconds.
Possible solution: add options timeout=X where X > 5 is how many seconds to wait. If I connect to the baz db on the same server, I'm able to retrieve the schema, presumably because it is able to query the data in under 5 seconds.
Am I doing something wrong?
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/CategoricalData/CQL/issues/45, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA2QKN6PVPI6QXHEEZTTNILR2WEGHANCNFSM4OVM7EOA.
Can you share your file and/or data?
Unfortunately some is not public and, as you might guess from the name sourcedata
it's all rather unpleasant and mostly singleton tables.
I edited the above description when I found the static_timeout
option but that seems to lead to a Null Pointer
error.
In general, is there a way to import a subset of a postgressql database? Say only one schema or if that's not possible, an explicit query from tables?
I think you are describing the usual jdbc import process: given a CQL schema S, and an SQL DB X, the 'import_jdbc' primitive lets you write one SQL query per CQL entity, that returns a column for each attribute and foreign key in S, and an 'id' column, and puts the data into a CQL S-instance. This method is preferred in part because, to faithfully preserve SQL semantics in CQL, imported SQL schemas have more columns than the actual imported DB and look kind of stylized.
I'll download a postgres database and try an import to see if I can track down the error. Usually there are some issues with JDBC compliance to deal with the first time a new vendor's jdbc driver is used; the commercial version of CQL uses JOOQ (vs JDBC) to bypass these issues entirely. My guess is either these issues or 'long running theorem proving' is leading to the exception.
On 7/9/20, Tim Pierson notifications@github.com wrote:
Can you share your file and/or data?
Unfortunately some is not public and, as you might guess from the name
sourcedata
it's all rather unpleasant and mostly singleton tables.I edited the above description when I found the
static_timeout
option but that seems to lead to aNull Pointer
error.In general, is there a way to import a subset of a postgressql database? Say only one schema or if that's not possible, an explicit query from tables?
-- You are receiving this because you commented. Reply to this email directly or view it on GitHub: https://github.com/CategoricalData/CQL/issues/45#issuecomment-656044293
I've since restored the schema that interests me to a separate database and am able to import it. I suspect there may have been a permissions error on some object or another in the database that may have been complicating things.
I have a large schema in postgres I'm trying to import but seem to be unable to set the timeout option. The entirety of my CQL file is:
This seems to always throw:
If I connect to the
baz
db on the same server, I'm able to retrieve the schema, presumably because it is able to query the data in under 5 seconds.Am I doing something wrong?
EDIT: having just written the above, I stumbled on the
static_timeout
option and setting that= 6000
seems to have made progress. However, I now get a Null pointer runtime error: