Is there a way of accessing a text file (read only of course) via a URL ?
I'd like to create a HSQLDB interface to some open data CSV files without having to copy them locally.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Even if we could read from a URL, this would have performance issues. The file is read once to create the indexes, then each time a row is required, a random access read takes place to read the row data on demand.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
OK - Thanks !
One other question - does HSQL keep track of the size or timestamp of a linked to local text file (in case it's contents change and it needs to recreate the indexes) ?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You should not change the contents of a linked text file.
Fair enough - but if contents are changed externally to HSQLDB, will it rescan them, or should I drop the table and recreate it and relink the file to pick up changes ?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I repeat: "You should not change the contents of a linked text file". If you do, you can expect mulfunction or crashes.
You use SET TABLE .. SOURCE { OFF | ON} to link or unlink the file. While unlinked, you can change the contents of the file. When linked again, the entire file will be read.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Is there a way of accessing a text file (read only of course) via a URL ?
I'd like to create a HSQLDB interface to some open data CSV files without having to copy them locally.
No.
Even if we could read from a URL, this would have performance issues. The file is read once to create the indexes, then each time a row is required, a random access read takes place to read the row data on demand.
OK - Thanks !
One other question - does HSQL keep track of the size or timestamp of a linked to local text file (in case it's contents change and it needs to recreate the indexes) ?
You should not change the contents of a linked text file.
Fair enough - but if contents are changed externally to HSQLDB, will it rescan them, or should I drop the table and recreate it and relink the file to pick up changes ?
I repeat: "You should not change the contents of a linked text file". If you do, you can expect mulfunction or crashes.
You use SET TABLE .. SOURCE { OFF | ON} to link or unlink the file. While unlinked, you can change the contents of the file. When linked again, the entire file will be read.
Great - thanks for that !