perhaps an ordering problem?

11 views
Skip to first unread message

Rob Sargent

unread,
Jun 9, 2021, 1:55:38 AM6/9/21
to jooq...@googlegroups.com
I'm wondering if the exception below is a consequence of the ordering of execution within jooq (or the gradle plugin?).  Or are stderr and stdout conspiring to confuse me.

Today for the first time in a while I had some new DDL to run.  I use flyway(6.3.2) for that and follow up with nu.studer.jooq(5.2).  The latter completed "successfully" but did show this stacktrace within the log output (abridged here):
INFO: Generating table         : Alias.java [input=alias, output=alias, pk=alias_pkey]
Jun 08, 2021 4:45:35 PM org.jooq.tools.JooqLogger info
INFO: Parse error              : Error when parsing column name : pv(events_less, events_equal, events_greater, 0)
org.jooq.impl.ParserException: Unknown function: [1:4] pv([*]events_less, events_equal, events_greater, 0)
    at org.jooq.impl.ParserContext.exception(ParserImpl.java:12258)
    at org.jooq.impl.ParserImpl.parseUnaryOps(ParserImpl.java:6557)
    at org.jooq.impl.ParserImpl.parseExp(ParserImpl.java:6521)
    at org.jooq.impl.ParserImpl.parseFactor(ParserImpl.java:6498)
    at org.jooq.impl.ParserImpl.parseSum(ParserImpl.java:6444)
    at org.jooq.impl.ParserImpl.parseNumericOp(ParserImpl.java:6429)
    at org.jooq.impl.ParserImpl.parseCollated(ParserImpl.java:6403)
    at org.jooq.impl.ParserImpl.parseConcat(ParserImpl.java:6393)
    at org.jooq.impl.ParserImpl.parsePredicate(ParserImpl.java:5323)
    at org.jooq.impl.ParserImpl.parseNot(ParserImpl.java:5253)
    at org.jooq.impl.ParserImpl.parseAnd(ParserImpl.java:5243)
    at org.jooq.impl.ParserImpl.parseOr(ParserImpl.java:5234)
    at org.jooq.impl.ParserImpl.parseField(ParserImpl.java:6310)
    at org.jooq.impl.ParserImpl.parseField(ParserImpl.java:6235)
    at org.jooq.impl.ParserImpl.parseField(ParserImpl.java:764)
    at org.jooq.impl.ParserImpl.parseField(ParserImpl.java:758)
    at org.jooq.meta.postgres.PostgresDatabase.tryParseColumnName(PostgresDatabase.java:266)
    at org.jooq.meta.postgres.PostgresDatabase.getIndexes0(PostgresDatabase.java:226)
    at org.jooq.meta.AbstractDatabase$14.run(AbstractDatabase.java:2338)
    at org.jooq.meta.AbstractDatabase.onError(AbstractDatabase.java:3094)
    at org.jooq.meta.AbstractDatabase.getIndexes(AbstractDatabase.java:2335)
    at org.jooq.meta.AbstractDatabase.getIndexes(AbstractDatabase.java:2369)
    at org.jooq.meta.AbstractTableDefinition.getIndexes(AbstractTableDefinition.java:99)
    at org.jooq.codegen.JavaGenerator.generateTable(JavaGenerator.java:5327)
    at org.jooq.codegen.JavaGenerator.generateTable(JavaGenerator.java:5038)
    at org.jooq.codegen.JavaGenerator.generateTables(JavaGenerator.java:5012)
    at org.jooq.codegen.JavaGenerator.generate(JavaGenerator.java:582)
    at org.jooq.codegen.JavaGenerator.generate(JavaGenerator.java:537)
    at org.jooq.codegen.JavaGenerator.generate(JavaGenerator.java:436)
    at org.jooq.codegen.GenerationTool.run0(GenerationTool.java:879)
    at org.jooq.codegen.GenerationTool.run(GenerationTool.java:233)
    at org.jooq.codegen.GenerationTool.generate(GenerationTool.java:228)
    at org.jooq.codegen.GenerationTool.main(GenerationTool.java:200)

Jun 08, 2021 4:45:35 PM org.jooq.tools.JooqLogger info
INFO: Indexes fetched          : 22 (22 included, 0 excluded)
Jun 08, 2021 4:45:35 PM org.jooq.tools.JooqLogger info
INFO: Generating table         : Cytoband.java [input=cytoband, output=cytoband, pk=N/A]
Funny thing is Alias has no reference to pv() function:
\d base.alias
                Table "base.alias"
  Column   | Type | Collation | Nullable | Default
-----------+------+-----------+----------+---------
 id        | uuid |           | not null |
 person_id | uuid |           | not null |
 aka       | text |           | not null |
 people_id | uuid |           |          |
 akadef_id | uuid |           |          |
Indexes:
    "alias_pkey" PRIMARY KEY, btree (id)
    "aliasperpeep" UNIQUE CONSTRAINT, btree (aka, people_id)
Foreign-key constraints:
    "alias_people_id_fkey" FOREIGN KEY (people_id) REFERENCES base.people(id)
    "alias_person_id_fkey" FOREIGN KEY (person_id) REFERENCES base.person(id)
    "defcon" FOREIGN KEY (akadef_id) REFERENCES base.definervalue(id)
I believe the only table which mentions that function is Segment:
\d sgstemplate.segment
                 Table "sgstemplate.segment"
      Column      |  Type   | Collation | Nullable | Default
------------------+---------+-----------+----------+---------
 id               | uuid    |           | not null |
 chrom            | integer |           | not null |
 markerset_id     | uuid    |           | not null |
 probandset_id    | uuid    |           | not null |
 startbase        | integer |           | not null |
 endbase          | integer |           | not null |
 firstmarker      | integer |           | not null |
 lastmarker       | integer |           | not null |
 events_less      | bigint  |           | not null | 0
 events_equal     | bigint  |           | not null | 0
 events_greater   | bigint  |           | not null | 0
 threshold_events | integer |           |          |
Indexes:
    "segment_pkey" PRIMARY KEY, btree (id)
    "useg" UNIQUE, btree (probandset_id, markerset_id, startbase, endbase) WITH (fillfactor='95')
    "fpvx" btree (pv(events_less, events_equal, events_greater, 0))
    "segment_markerset_id_idx" btree (markerset_id)
    "segment_probandset_id_idx" btree (probandset_id)
Foreign-key constraints:
    "segment_markerset_id_fkey" FOREIGN KEY (markerset_id) REFERENCES base.markerset(id)
    "segment_probandset_id_fkey" FOREIGN KEY (probandset_id) REFERENCES sgstemplate.probandset(id)
Referenced by:
    TABLE "sgstemplate.chaseable" CONSTRAINT "chaseable_segment_id_fkey" FOREIGN KEY (segment_id) REFERENCES sgstemplate.segment(id)
    TABLE "sgstemplate.duo_chaseable" CONSTRAINT "duo_chaseable_segment1_id_fkey" FOREIGN KEY (segment1_id) REFERENCES sgstemplate.segment(id)
    TABLE "sgstemplate.duo_chaseable" CONSTRAINT "duo_chaseable_segment2_id_fkey" FOREIGN KEY (segment2_id) REFERENCES sgstemplate.segment(id)
    TABLE "sgstemplate.optimalset_segment" CONSTRAINT "threshold_segment_threshold_segment_fkey" FOREIGN KEY (segment_id) REFERENCES sgstemplate.segment(id)
A subsequent run of  'gradle build' says the generateJooq task is up-to-date.

Lukas Eder

unread,
Jun 9, 2021, 3:13:55 AM6/9/21
to jOOQ User Group
The code generator doesn't support function based indexes yet:

But we're still trying to parse expressions in case they're not actually functions, but just alternative spellings of columns:

The logging of the exception and stack trace were done to help people report any further issues / oversights / edge cases in this area, which might not be related to function based indexes.

I hope this helps,
Lukas

--
You received this message because you are subscribed to the Google Groups "jOOQ User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jooq-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jooq-user/36b26ba2-4eff-92de-3d8b-933d3b088194%40gmail.com.

Rob Sargent

unread,
Jun 9, 2021, 3:15:14 AM6/9/21
to jooq...@googlegroups.com
roger that.  Thank you.

Lukas Eder

unread,
Jun 9, 2021, 3:24:07 AM6/9/21
to jOOQ User Group
Well, I guess we could suppress the stack trace for unknown functions by specifying Settings.parseUnknownFunctions = IGNORE. We already parse known functions (e.g. UPPER()) and ignore them later on, due to function based indexes not being supported. So, this particular parser error doesn't add much value. Even if we parsed the function, the index would be ignored.

I'll improve this for jOOQ 3.15:

Thanks again for your report.
Lukas

--
You received this message because you are subscribed to the Google Groups "jOOQ User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jooq-user+...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages