Re: [JDBC] Regarding GSoc Application

From: Merlin Moncure <mmoncure(at)gmail(dot)com>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Atri Sharma <atri(dot)jiit(at)gmail(dot)com>, Dave Cramer <pg(at)fastcrypt(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: [JDBC] Regarding GSoc Application
Date: 2012-04-10 15:10:58
Message-ID: CAHyXU0wUg1TLdyMm0PzQwgYb6iRyCP4+YkqqaxWGUNUZLsj_PA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-jdbc

On Tue, Apr 10, 2012 at 9:47 AM, Andrew Dunstan <andrew(at)dunslane(dot)net> wrote:
> I don't understand what the heck you're talking about, TBH. From a user
> perspective there is nothing to work out. It will look like any other FDW.

yes, that is correct.

> The implementor of the FDW handler will have to work out the glue between
> postgres and the JVM, but that's not going to be you, right?

Correct. I think I understand what you're driving at. Basically,
pl/java is the glue. my thinking was inside the FDW callbacks to to do
SPI calls to invoke the pl/java routines. Unlike other fdw
implementations which mostly wrap C libraries -- which makes things
very easy since you can directly jump into the routine for foreign
execution -- a luxury we don't have. We have to invoke java and there
are two basic ways to tie into the java runtime: one is to jump
through SPI via the SQL executor. The other is JNI into the pl/java
jvm which I think you were hinting was the better approach.

Doing an SPI call from a FDW callback is inefficient -- that's an
extra call into the executor (although you can prepare it) and you
have to walk the SPI result just to build it up again in the FDW
iterator. A JNI solution instead would jump into the jvm and do java
invocation and I believe would drive the difficulty of this project up
a couple of notches whereas a SPI approach utilizes a well documented
interface. We're not stuck on the approach though -- I'm pushing Atri
to get the environment set up so we can explore alternative solutions.

In other words, our proposal is basically pretty similar to what you'd
end up with if you wrapped dblink into a fdw making dblink calls
inside the fdw over spi.

merlin

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Stark 2012-04-10 15:18:19 Re: To Do wiki
Previous Message Fujii Masao 2012-04-10 15:07:41 Re: [streaming replication] 9.1.3 streaming replication bug ?

Browse pgsql-jdbc by date

  From Date Subject
Next Message Tom Lane 2012-04-10 15:25:05 Re: [JDBC] Regarding GSoc Application
Previous Message Andrew Dunstan 2012-04-10 14:47:43 Re: [JDBC] Regarding GSoc Application