Skip to content

Commit d90bb9a

Browse files
committed
refactor: rename StreamingResultSet to DataCloudResultSet, drop marker interface
Pre-unify there were three result-set implementations: StreamingResultSet (streaming Arrow query results), DataCloudMetadataResultSet (metadata), SimpleResultSet (in-memory rows). The DataCloudResultSet interface — a one-method (getQueryId) extension over java.sql.ResultSet — was the common "implements" the public API surfaced; StreamingResultSet was the only one that ever implemented it as a non-trivial impl. The unify refactor collapsed all three implementations into StreamingResultSet, but kept the interface and the "Streaming" name. Two problems fall out: - The "Streaming" name now lies. Metadata results flow through the same class but they're a one-shot in-memory IPC blob — nothing streaming about them. MetadataResultSets.of even passes /*queryId=*/ null because there is no query. - The DataCloudResultSet interface has one implementer and one method. Layering an interface for one impl is just a reader trap: callers instinctively look for "what other implementations exist" and find none. Collapse the two: - Rename the class StreamingResultSet -> DataCloudResultSet. - Delete the old DataCloudResultSet interface (the public method getQueryId() now lives directly on the class via @Getter). - Update all production and test references; rename the affected test files to match (StreamingResultSet*Test -> DataCloudResultSet*Test). The public API surface is unchanged in source for the common cases: DataCloudConnection.getRowBasedResultSet / getChunkBasedResultSet still return DataCloudResultSet, just as a class instead of an interface. This is binary-incompatible for any caller that ever cast to or implemented the old interface; in practice only StreamingResultSet implemented it on the read side, and no code outside the driver implemented it on the write side.
1 parent acc241e commit d90bb9a

13 files changed

Lines changed: 542 additions & 555 deletions

jdbc-core/src/main/java/com/salesforce/datacloud/jdbc/core/ArrowStreamReaderCursor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@
2323
import org.apache.arrow.vector.ipc.ArrowStreamReader;
2424

2525
/**
26-
* Row cursor over an {@link ArrowStreamReader} that drives the {@link StreamingResultSet}.
26+
* Row cursor over an {@link ArrowStreamReader} that drives the {@link DataCloudResultSet}.
2727
*
2828
* <p>The cursor owns the supplied {@link BufferAllocator} alongside the reader: closing the
2929
* cursor closes the reader (which releases ArrowBuf accounting) and then the allocator (which
3030
* returns its budget). This is the single place that guarantees root-allocator hygiene for the
31-
* driver; callers of {@link StreamingResultSet#of} hand ownership over and do not close the
31+
* driver; callers of {@link DataCloudResultSet#of} hand ownership over and do not close the
3232
* allocator themselves.
3333
*/
3434
@Slf4j

jdbc-core/src/main/java/com/salesforce/datacloud/jdbc/core/DataCloudConnection.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ public DataCloudResultSet getRowBasedResultSet(String queryId, long offset, long
221221
QueryResultArrowStream.OUTPUT_FORMAT);
222222
val arrowStream = SQLExceptionQueryResultIterator.createSqlExceptionArrowStreamReader(
223223
iterator, connectionProperties.isIncludeCustomerDetailInReason(), queryId, null);
224-
return StreamingResultSet.of(arrowStream, queryId, ZoneId.systemDefault());
224+
return DataCloudResultSet.of(arrowStream, queryId, ZoneId.systemDefault());
225225
} catch (StatusRuntimeException ex) {
226226
throw QueryExceptionHandler.createException(
227227
connectionProperties.isIncludeCustomerDetailInReason(), null, queryId, ex);
@@ -264,7 +264,7 @@ public DataCloudResultSet getChunkBasedResultSet(String queryId, long chunkId, l
264264
QueryResultArrowStream.OUTPUT_FORMAT);
265265
val arrowStream = SQLExceptionQueryResultIterator.createSqlExceptionArrowStreamReader(
266266
iterator, connectionProperties.isIncludeCustomerDetailInReason(), queryId, null);
267-
return StreamingResultSet.of(arrowStream, queryId, ZoneId.systemDefault());
267+
return DataCloudResultSet.of(arrowStream, queryId, ZoneId.systemDefault());
268268
} catch (StatusRuntimeException ex) {
269269
throw QueryExceptionHandler.createException(
270270
connectionProperties.isIncludeCustomerDetailInReason(), null, queryId, ex);

0 commit comments

Comments
 (0)