-
Notifications
You must be signed in to change notification settings - Fork 9
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
Add Flight JDBC Connection String example #190
Comments
Could you try @lidavidm Can we specify |
https://arrow.apache.org/docs/java/flight_sql_jdbc_driver.html#connecting-to-a-database
So just appending |
I tried with the followng
It doesn't work, I am also connected with Postgres JDBC provider on port 5432 and that works ccrrectly. I tried also useEncryption=1. The following jdbc connection string works
|
Could you try |
I figured it out reading carefully the logs that there was a previous problem that was hiding the real problem.
I realized that the arrow-flight was only binding on 127.0.0.1 and my docker-compose was not mapping that, I discovered that via grpccurl. It might be a good idea to align the arrow-flight-sql binding behavior to the one of the "traditional" connector. However, this didn't solve the problem, I created a small snippet public final class ArrowExample {
public static void main(String []args) throws Exception{
DriverManager.registerDriver(new ArrowFlightJdbcDriver());
Driver driver = DriverManager.getDriver("jdbc:arrow-flight://localhost:15432");
Connection connection = driver.connect("jdbc:arrow-flight-sql://localhost:15432/?username=postgres&password=mypassword&useEncryption=0&database=ah_arrow", new Properties());
Statement statement = connection.createStatement();
ResultSet rs = statement.executeQuery("select * from public.people");
System.out.println("Hello world");
}
} this fails like so: java.sql.SQLException: Error while executing SQL "select * from public.people": Network closed for unknown reason If I enable useEncryption=1, it fails during TSL negotiation. |
Could you share PostgreSQL log on the error? |
Is there a different log for arrow ? The console doesn't show anything |
arrow-flight-sql-postgresql uses the same log as PostgreSQL's one. |
Isn't the URI in the code snippet still using |
I have some additional interesting infos. Connecting from within the container works: telnet localhost 15432
Trying ::1...
Connection failed: Connection refused
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
???@Did not receive HTTP/2 settings before handshake timeoutConnection closed by foreign host. Container from the outside container
|
I tried that, doesn't make a difference. It looks like a problem with networking. I need to figure out why |
Could you provide your |
services:
postgres:
image: "ghcr.io/apache/arrow-flight-sql-postgresql:main-bookworm-15"
platform: "linux/amd64"
environment:
POSTGRES_DB: ah_arrow
POSTGRES_USER: postgres
POSTGRES_PASSWORD: mypassword
volumes:
- ./init.sql:/docker-entrypoint-initdb.d/init.sql
ports:
- "5432:5432"
- "127.0.0.1:15432:15432" |
Thanks. |
Sure, the table is minimal I was really only trying to get the connector to work CREATE TABLE people (
phone_number VARCHAR(255)
);
INSERT INTO people (phone_number) VALUES ('123-45-6789');
INSERT INTO people (phone_number) VALUES ('987-65-4321');
INSERT INTO people (phone_number) VALUES ('555-55-5555'); |
Thanks. Could you try again after |
Thank you, now I get a connection error
if i use enableEncryption=0, if I use enableEncryption=1 instead I get an SSL Exception |
OK. Could you change the last |
Thanks, this is not something I can disable at client level right? |
Right. |
I have tried to connect using the JDBC driver added to my Intellij IDEA, with a different combinations of parameters. The driver failed with:
org.apache.arrow.driver.jdbc.shaded.org.flight.FlightRuntimeException: UNAVAILABLE io Exception
Any help would be highly appreciated
The text was updated successfully, but these errors were encountered: