[
https://issues.apache.org/jira/browse/PIG-1229?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12894975#action_12894975
]
Aaron Kimball commented on PIG-1229:
------------------------------------
Haven't looked at how you're using hsqldb in this patch, but I've got a lot of
experience using HSQLDB for testing.
If you're running one or more tests in a single process that requires an
HSQLDB-backed database, you do not need to create a new instance of Server. You
can just set your JDBC connect string to {{jdbc:hsqldb:mem:foodbname}} and get
a {{Connection}} instance to a memory-backed single-process database called
{{foodbname}}. This database will exist for the lifetime of the Java process.
You can have multiple {{Connection}} instances (concurrently or serially) open
to this database and it will function like you expect a database to work like.
The advantage of not using a server is that this does not require binding a
port; therefore you can run multiple tests concurrently without worrying about
collisions. Similarly, there's no need to use the {{jdbc:hsqldb:file}} protocol
unless you want to restore the contents of the database in a subsequent
process. When your Java process ends, you won't have a bonus file to clean up
with {{jdbc:hsqldb:mem}}.
Of course, if you're testing with {{MiniMRCluster}} or something, you'll want
to start a Server so that the external mapper processes can connect to the same
database via {{jdbc:hsqldb:hsql://server:port/dbname}}.
> allow pig to write output into a JDBC db
> ----------------------------------------
>
> Key: PIG-1229
> URL: https://issues.apache.org/jira/browse/PIG-1229
> Project: Pig
> Issue Type: New Feature
> Components: impl
> Reporter: Ian Holsman
> Assignee: Ankur
> Priority: Minor
> Fix For: 0.8.0
>
> Attachments: jira-1229-final.patch, jira-1229-final.test-fix.patch,
> jira-1229-v2.patch, jira-1229-v3.patch, pig-1229.2.patch, pig-1229.patch
>
>
> UDF to store data into a DB
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.