You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thank you for the new release of the driver, I am now able to connect to a KSQL instance. I am able to query metadata (SHOW STREAMS; SHOW TABLES; etc.) however I am having trouble finding a way to query old data from a table where the query wont hang.
The code snippet I'm using:
// query: SELECT * FROM USERS_ORIGINAL LIMIT 3
//rs.beforeFirst(); // <<NOT SUPPORTED
while (rs.next()) { // << "HANGS" HERE
for (int colInd = 1; colInd <= rsMetaData.getColumnCount(); colInd++){
String val = rs.getString(colInd);
System.out.print(val);
System.out.print("\t");
}
System.out.println();
}
The issue seems to be that the pointer for a table is always at the latest position, so when I run the query the driver seems to hang because there is no data coming in. I see that there is a way to set the offset to the earliest position using the following command
SET 'auto.offset.reset' = 'earliest';
but this doesn't seem to be supported by the driver. Do you know if there is a way to set this globally for the KSQL instance or if there's a way to specify this in the query itself?
Much appreciated.
Daniel
The text was updated successfully, but these errors were encountered:
You can set properties in the driver setting the flag properties=true and adding the properties you like. Besides that, you can also configure the timeout property to end the query if the data is not coming.
doesn't seem to set that property for the request. I was able to set this property globally in the KSQL config with the form auto.offset.reset=earliest and in the KSQL shell using SET 'auto.offset.reset' = 'earliest'; however via the JDBC URL it doesn't seem to set. Trying to add quotes, or using SET cant pass the regex check.
Hi Mario,
Thank you for the new release of the driver, I am now able to connect to a KSQL instance. I am able to query metadata (SHOW STREAMS; SHOW TABLES; etc.) however I am having trouble finding a way to query old data from a table where the query wont hang.
The code snippet I'm using:
The issue seems to be that the pointer for a table is always at the latest position, so when I run the query the driver seems to hang because there is no data coming in. I see that there is a way to set the offset to the earliest position using the following command
SET 'auto.offset.reset' = 'earliest';
but this doesn't seem to be supported by the driver. Do you know if there is a way to set this globally for the KSQL instance or if there's a way to specify this in the query itself?
Much appreciated.
Daniel
The text was updated successfully, but these errors were encountered: