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

Broken H2 files on downloads.ohsome.org #532

Closed
SlowMo24 opened this issue Jun 27, 2024 · 1 comment
Closed

Broken H2 files on downloads.ohsome.org #532

SlowMo24 opened this issue Jun 27, 2024 · 1 comment
Labels
bug Something isn't working as expected

Comments

@SlowMo24
Copy link
Contributor

Bug Description

Some provided h2 files from downloads.ohsome.org cannot be used with the OSHDB Application.

How to Reproduce

  1. Go to downloads.ohsome.org and download https://downloads.ohsome.org/OSHDB/v1.0/europe/germany/baden-wuerttemberg/karlsuhe-regbez.oshdb.mv.db (typo in file name)

  2. Run OHSHDBApplication example:
    example.zip

  3. See error

 mvn exec:java -Dexec.mainClass="org.test.H2Test" -Dexec.args="--oshdb h2:../karlsuhe-regbez.oshdb.mv.db"
[INFO] Scanning for projects...
[INFO] 
[INFO] ------------------< org.example:FailedToReadOSHDBH2 >-------------------
[INFO] Building FailedToReadOSHDBH2 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- exec-maven-plugin:3.1.0:java (default-cli) @ FailedToReadOSHDBH2 ---
SLF4J: No SLF4J providers were found.
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#noProviders for further details.
SLF4J: Class path contains SLF4J bindings targeting slf4j-api versions prior to 1.8.
SLF4J: Ignoring binding found at [jar:file:/home/mschott/.m2/repository/org/slf4j/slf4j-simple/1.7.36/slf4j-simple-1.7.36.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#ignoredBindings for an explanation.
org.heigit.ohsome.oshdb.util.exceptions.OSHDBException: Tabelle "key" nicht gefunden
Table "key" not found; SQL statement:
SELECT id, txt from "key" k where k.txt = ? [42102-197]
        at org.heigit.ohsome.oshdb.util.tagtranslator.JdbcTagTranslator.getOSHDBTagKeyOf(JdbcTagTranslator.java:76)
        at org.heigit.ohsome.oshdb.util.tagtranslator.TagTranslator.getOSHDBTagKeyOf(TagTranslator.java:32)
        at org.heigit.ohsome.oshdb.util.taginterpreter.DefaultTagInterpreter.<init>(DefaultTagInterpreter.java:89)
        at org.heigit.ohsome.oshdb.util.taginterpreter.DefaultTagInterpreter.<init>(DefaultTagInterpreter.java:50)
        at org.heigit.ohsome.oshdb.api.mapreducer.MapReducer.getTagInterpreter(MapReducer.java:1670)
        at org.heigit.ohsome.oshdb.api.mapreducer.backend.MapReducerJdbcSinglethread.reduce(MapReducerJdbcSinglethread.java:63)
        at org.heigit.ohsome.oshdb.api.mapreducer.backend.MapReducerJdbcSinglethread.mapReduceCellsOSMEntitySnapshot(MapReducerJdbcSinglethread.java:152)
        at org.heigit.ohsome.oshdb.api.mapreducer.MapReducer.reduce(MapReducer.java:860)
        at org.heigit.ohsome.oshdb.api.mapreducer.MapReducer.reduce(MapReducer.java:978)
        at org.heigit.ohsome.oshdb.api.mapreducer.MapReducer.sum(MapReducer.java:1017)
        at org.heigit.ohsome.oshdb.api.mapreducer.MapReducer.count(MapReducer.java:1028)
        at org.test.H2Test.run(H2Test.java:25)
        at org.heigit.ohsome.oshdb.helpers.applicationtemplate.OSHDBApplication.setAndRun(OSHDBApplication.java:103)
        at org.heigit.ohsome.oshdb.helpers.db.OSHDBDriver.connectToH2(OSHDBDriver.java:95)
        at org.heigit.ohsome.oshdb.helpers.db.OSHDBDriver.connectToH2(OSHDBDriver.java:83)
        at org.heigit.ohsome.oshdb.helpers.db.OSHDBDriver.connect(OSHDBDriver.java:67)
        at org.heigit.ohsome.oshdb.helpers.applicationtemplate.OSHDBApplication.call(OSHDBApplication.java:94)
        at org.heigit.ohsome.oshdb.helpers.applicationtemplate.OSHDBApplication.call(OSHDBApplication.java:42)
        at picocli.CommandLine.executeUserObject(CommandLine.java:2041)
        at picocli.CommandLine.access$1500(CommandLine.java:148)
        at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2461)
        at picocli.CommandLine$RunLast.handle(CommandLine.java:2453)
        at picocli.CommandLine$RunLast.handle(CommandLine.java:2415)
        at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2273)
        at picocli.CommandLine$RunLast.execute(CommandLine.java:2417)
        at picocli.CommandLine.execute(CommandLine.java:2170)
        at org.heigit.ohsome.oshdb.helpers.applicationtemplate.OSHDBApplication.run(OSHDBApplication.java:82)
        at org.test.H2Test.main(H2Test.java:11)
        at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:279)
        at java.base/java.lang.Thread.run(Thread.java:840)
Caused by: org.h2.jdbc.JdbcSQLException: Tabelle "key" nicht gefunden
Table "key" not found; SQL statement:
SELECT id, txt from "key" k where k.txt = ? [42102-197]
        at org.h2.message.DbException.getJdbcSQLException(DbException.java:357)
        at org.h2.message.DbException.get(DbException.java:179)
        at org.h2.message.DbException.get(DbException.java:155)
        at org.h2.command.Parser.readTableOrView(Parser.java:5920)
        at org.h2.command.Parser.readTableFilter(Parser.java:1430)
        at org.h2.command.Parser.parseSelectSimpleFromPart(Parser.java:2138)
        at org.h2.command.Parser.parseSelectSimple(Parser.java:2287)
        at org.h2.command.Parser.parseSelectSub(Parser.java:2133)
        at org.h2.command.Parser.parseSelectUnion(Parser.java:1946)
        at org.h2.command.Parser.parseSelect(Parser.java:1919)
        at org.h2.command.Parser.parsePrepared(Parser.java:463)
        at org.h2.command.Parser.parse(Parser.java:335)
        at org.h2.command.Parser.parse(Parser.java:307)
        at org.h2.command.Parser.prepareCommand(Parser.java:278)
        at org.h2.engine.Session.prepareLocal(Session.java:611)
        at org.h2.engine.Session.prepareCommand(Session.java:549)
        at org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java:1247)
        at org.h2.jdbc.JdbcPreparedStatement.<init>(JdbcPreparedStatement.java:76)
        at org.h2.jdbc.JdbcConnection.prepareStatement(JdbcConnection.java:304)
        at org.heigit.ohsome.oshdb.util.tagtranslator.JdbcTagTranslator.getOSHDBTagKeyOf(JdbcTagTranslator.java:67)
        ... 29 more

Expected behaviour

Return the number of nodes in Regierungsbezirk Karlsruhe.

Further Information

The error is due to the OSHDB code expecting a lower case "key" table name while the provided H2 has an upper case "KEY" table name.

System information

Please complete the following information:

  • OS: Ubuntu 22.04
  • Java Version: openjdk 17.0.11 2024-04-16
  • OSHDB 1.2.2
  • Maven version: 3.6.3
@SlowMo24 SlowMo24 added the bug Something isn't working as expected label Jun 27, 2024
@tyrasd
Copy link
Member

tyrasd commented Jul 11, 2024

Fixed in the download files now (interestingly, only the key table was picky about the uppercase/lowercase difference). I've also fixed the typo in the filename. Thanks for reporting!

@tyrasd tyrasd closed this as completed Jul 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working as expected
Projects
None yet
Development

No branches or pull requests

2 participants