Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
cf3b5f8
MINOR: Bump org.codehaus.mojo:versions-maven-plugin from 2.25.1 to 2.…
dependabot[bot] Nov 23, 2026
0cd2f59
MINOR: Bump logback.version from 1.6.6 to 1.6.8 (#1515)
dependabot[bot] Nov 23, 2026
c3c3e45
MINOR: Bump at.yawk.lz4:lz4-java from 1.14.0 to 1.14.1 (#1514)
dependabot[bot] Nov 23, 2026
0270ba6
MINOR: Bump io.netty:netty-bom from 4.2.20.Final to 4.2.21.Final (#1513)
dependabot[bot] Nov 23, 2026
c39ccdd
MINOR: Bump error_prone_core.version from 2.52.0 to 2.53.0 (#1512)
dependabot[bot] Nov 23, 2026
a655068
MINOR: Bump com.google.api.grpc:proto-google-common-protos from 2.81.…
dependabot[bot] Nov 23, 2026
14fef46
MINOR: Bump com.github.luben:zstd-jni from 1.5.7-26 to 1.5.7-28 (#1510)
dependabot[bot] Nov 23, 2026
a99297c
MINOR: [Flight] Fix cookie header parsing in ServerSessionMiddleware …
Arawoof06 Nov 23, 2026
1718ad7
MINOR: Decode decimal holders with the correct byte order and byte of…
robert3005 Nov 23, 2026
66d7085
GH-832: [Avro] Use readString in AvroStringConsumer (#1520)
dragonknightk Nov 24, 2026
758fb56
GH-1268: [JDBC] Honor DriverManager login timeout (#1507)
Ap-95671 Nov 24, 2026
f51583b
MINOR: Preserve Decimal256 type metadata in promoted union writers (#…
robert3005 Nov 24, 2026
fd5fb7c
GH-1497: [CI] Compute pom.xml paths without Python in build.sh (#1498)
andygrove Nov 25, 2026
10c55b9
MINOR: Reject truncated UTF-8 sequences in Text.validateUTF8 (#1522)
Arawoof06 Nov 25, 2026
6ae8046
BDX-645: prototype PollInfo support for JDBC
xborder Sep 10, 2026
72ebaec
BDX-645: document JDBC request flow
xborder Sep 11, 2026
8491b11
BDX-645: fix Mermaid request flow syntax
xborder Sep 11, 2026
c02cbef
BDX-645: consume PollInfo endpoints progressively
xborder Sep 11, 2026
6d72dc0
BDX-645: record progressive JDBC regression
xborder Sep 11, 2026
3949929
BDX-645: adapt JDBC PollInfo POC to upstream main
xborder Nov 25, 2026
b444a25
BDX-645: add JDBC production go/no-go and rebase re-validation
xborder Nov 25, 2026
2ff4c37
BDX-645: model-check the JDBC poll-ahead proposal with TLA+
xborder Nov 25, 2026
f4395fa
BDX-645: add JDBC poll-ahead implementation plan
xborder Nov 26, 2026
d7c3ed4
BDX-645: poll ahead on progressive PollFlightInfo results (JDBC)
xborder Nov 26, 2026
f9a978c
BDX-645: sync the poll-ahead TLA+ model with the implementation
xborder Nov 26, 2026
dadd45d
BDX-645: poll-ahead unit tests; fix stranded reader after a rejected …
xborder Nov 26, 2026
1daebc7
BDX-645: sync the poll-ahead TLA+ model with the idle-flag fix
xborder Nov 26, 2026
d58d2ca
BDX-645: end-to-end poll-ahead tests against the conformance server
xborder Nov 26, 2026
4b83155
BDX-645: fix poll-ahead correctness findings (slot release, errors, f…
xborder Nov 26, 2026
704ae1a
BDX-645: make the shared-server tests fork-safe and deterministic
xborder Nov 26, 2026
3158822
BDX-645: fix the poll-ahead unit-test review findings
xborder Nov 26, 2026
436156f
BDX-645: do not interrupt a poller's CancelFlightInfo when the connec…
xborder Nov 26, 2026
f6374c4
BDX-645: sync the poll-ahead TLA+ model with the slot-release and err…
xborder Nov 26, 2026
2574a51
BDX-645: make the backoff cancel and close tests wait inside the backoff
xborder Nov 26, 2026
c77fa20
BDX-645: move the poll-ahead verification sync commit to 2574a511c
xborder Nov 26, 2026
b618dbc
BDX-645: update the go/no-go doc for poll-ahead
xborder Nov 26, 2026
b19d837
BDX-645: remove the first POC's reader-side polling; poll-ahead only
xborder Nov 26, 2026
481ce86
BDX-645: model the rejected poller start; sync the poll-ahead model w…
xborder Nov 26, 2026
1aba194
BDX-645: update the plan and go/no-go doc for poll-ahead only
xborder Nov 26, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
205 changes: 205 additions & 0 deletions .claude/skills/verify-jdbc-poll-ahead/SKILL.md

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@
package org.apache.arrow.adapter.avro.consumers;

import java.io.IOException;
import java.nio.ByteBuffer;
import org.apache.arrow.vector.VarCharVector;
import org.apache.avro.io.Decoder;
import org.apache.avro.util.Utf8;

/**
* Consumer which consume string type values from avro decoder. Write the data to {@link
* VarCharVector}.
*/
public class AvroStringConsumer extends BaseAvroConsumer<VarCharVector> {

private ByteBuffer cacheBuffer;
private Utf8 cacheUtf8;

/** Instantiate a AvroStringConsumer. */
public AvroStringConsumer(VarCharVector vector) {
Expand All @@ -36,9 +36,9 @@ public AvroStringConsumer(VarCharVector vector) {

@Override
public void consume(Decoder decoder) throws IOException {
// cacheBuffer is initialized null and create in the first consume,
// if its capacity < size to read, decoder will create a new one with new capacity.
cacheBuffer = decoder.readBytes(cacheBuffer);
vector.setSafe(currentIndex++, cacheBuffer, 0, cacheBuffer.limit());
// cacheUtf8 starts null and is reused; the Utf8 grows its backing array
// when needed, so only getByteLength() bytes are valid.
cacheUtf8 = decoder.readString(cacheUtf8);
vector.setSafe(currentIndex++, cacheUtf8.getBytes(), 0, cacheUtf8.getByteLength());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,15 @@

import static org.junit.jupiter.api.Assertions.assertEquals;

import java.io.ByteArrayOutputStream;
import java.nio.ByteBuffer;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import org.apache.arrow.adapter.avro.consumers.AvroStringConsumer;
import org.apache.arrow.vector.FieldVector;
import org.apache.arrow.vector.VarCharVector;
import org.apache.arrow.vector.VectorSchemaRoot;
Expand All @@ -34,6 +36,11 @@
import org.apache.avro.Schema;
import org.apache.avro.generic.GenericData;
import org.apache.avro.generic.GenericRecord;
import org.apache.avro.io.BinaryDecoder;
import org.apache.avro.io.BinaryEncoder;
import org.apache.avro.io.DecoderFactory;
import org.apache.avro.io.EncoderFactory;
import org.apache.avro.io.ResolvingDecoder;
import org.junit.jupiter.api.Test;

public class AvroToArrowTest extends AvroTestBase {
Expand All @@ -49,6 +56,42 @@ public void testStringType() throws Exception {
checkPrimitiveResult(data, vector);
}

/**
* Regression for issue 832. {@code AvroStringConsumer} used {@code Decoder.readBytes}, so a
* {@link ResolvingDecoder} whose reader schema is a string threw {@code AvroTypeException}:
* "Attempt to process a bytes when a string was expected." Values are written with {@code
* Encoder.writeString} and include an empty string and a non-ASCII literal so the reused {@code
* Utf8} buffer is copied with the correct byte length.
*/
@Test
public void testStringTypeWithResolvingDecoder() throws Exception {
Schema schema = getSchema("test_primitive_string.avsc");
List<String> data = Arrays.asList("v1", "", "你好世界");

ByteArrayOutputStream out = new ByteArrayOutputStream();
BinaryEncoder encoder = EncoderFactory.get().directBinaryEncoder(out, null);
for (String value : data) {
encoder.writeString(value);
}
encoder.flush();

DecoderFactory factory = DecoderFactory.get();
BinaryDecoder binaryDecoder = factory.binaryDecoder(out.toByteArray(), null);
ResolvingDecoder resolvingDecoder = factory.resolvingDecoder(schema, schema, binaryDecoder);

VarCharVector vector = new VarCharVector("str", config.getAllocator());
try (AvroStringConsumer consumer = new AvroStringConsumer(vector)) {
vector.allocateNew();
for (int i = 0; i < data.size(); i++) {
resolvingDecoder.configure(binaryDecoder);
consumer.consume(resolvingDecoder);
resolvingDecoder.drain();
}
vector.setValueCount(data.size());
checkPrimitiveResult(data, vector);
}
}

@Test
public void testNullableStringType() throws Exception {
Schema schema = getSchema("test_nullable_string.avsc");
Expand Down
2 changes: 1 addition & 1 deletion bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ under the License.
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
<version>2.25.1</version>
<version>2.25.2</version>
</plugin>
</plugins>
</pluginManagement>
Expand Down
14 changes: 4 additions & 10 deletions ci/scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,11 @@ cp -r "${source_dir}/arrow-format" "${build_dir}"
cp -r "${source_dir}/dev" "${build_dir}"

# Instead of hardcoding the list of directories to copy, find pom.xml and then
# crawl back up to the top. GNU realpath has --relative-to but this does not
# work on macOS

poms=$(find "${source_dir}" -not \( -path "${source_dir}"/build -prune \) -type f -name pom.xml)
if [[ "$OSTYPE" == "darwin"* ]]; then
poms=$(echo "$poms" | xargs -n1 python -c "import sys; import os.path; print(os.path.relpath(sys.argv[1], '${source_dir}'))")
else
poms=$(echo "$poms" | xargs -n1 realpath -s --relative-to="${source_dir}")
fi
# crawl back up to the top.
poms=$(cd "${source_dir}" && find . -not \( -path ./build -prune \) -type f -name pom.xml)

for source_root in $(echo "${poms}" | awk -F/ '{print $1}' | sort -u); do
# ./dataset/pom.xml -> dataset
for source_root in $(echo "${poms}" | awk -F/ '{print $2}' | sort -u); do
cp -r "${source_dir}/${source_root}" "${build_dir}"
done

Expand Down
4 changes: 2 additions & 2 deletions compression/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@ under the License.
<dependency>
<groupId>com.github.luben</groupId>
<artifactId>zstd-jni</artifactId>
<version>1.5.7-26</version>
<version>1.5.7-28</version>
</dependency>
<dependency>
<groupId>at.yawk.lz4</groupId>
<artifactId>lz4-java</artifactId>
<version>1.14.0</version>
<version>1.14.1</version>
</dependency>
</dependencies>
</project>
7 changes: 7 additions & 0 deletions docs/source/flight_sql_jdbc_driver.rst
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,13 @@ DriverManager#getConnection()
the username and password supplied on the URI supercede the username and
password arguments to the function call.

Use ``DriverManager.setLoginTimeout(seconds)`` to limit the time the driver
waits for a connection, including the authentication handshake and initial
session setup. On expiration, the driver cancels pending login RPCs and throws
``SQLTimeoutException``. A value of zero disables the login timeout. The
``connectTimeoutMs`` property separately controls the Netty socket connection
timeout.

OAuth 2.0 Authentication
========================

Expand Down
2 changes: 1 addition & 1 deletion flight/flight-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ under the License.
<dependency>
<groupId>com.google.api.grpc</groupId>
<artifactId>proto-google-common-protos</artifactId>
<version>2.81.0</version>
<version>2.82.0</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,21 @@ public ServerSessionMiddleware onCallStarted(
final Iterable<String> it = incomingHeaders.getAll("cookie");
findIdCookie:
for (final String headerValue : it) {
for (final String cookie : headerValue.split(" ;")) {
final String[] cookiePair = cookie.split("=");
if (cookiePair.length != 2) {
// RFC 6265: cookie-pairs are separated by "; " and a value may itself contain '='
for (final String cookie : headerValue.split(";")) {
final int separator = cookie.indexOf('=');
if (separator == -1) {
// Soft failure: Ignore invalid cookie list field
break;
continue;
}

if (sessionCookieName.equals(cookiePair[0]) && cookiePair[1].length() > 0) {
sessionId = cookiePair[1];
final String name = cookie.substring(0, separator).trim();
String value = cookie.substring(separator + 1).trim();
if (value.length() >= 2 && value.startsWith("\"") && value.endsWith("\"")) {
value = value.substring(1, value.length() - 1);
}
if (sessionCookieName.equals(name) && !value.isEmpty()) {
sessionId = value;
break findIdCookie;
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.arrow.flight;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertSame;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;

import org.apache.arrow.flight.grpc.RequestContextAdapter;
import org.junit.jupiter.api.Test;

public class TestServerSessionMiddleware {
private static final String SESSION_ID = "6f1a3c8e-2b4d-4f7a-9c0e-1d2e3f4a5b6c";
private static final CallInfo CALL_INFO = new CallInfo(FlightMethod.DO_ACTION);

/** Creates a factory holding one session with {@link #SESSION_ID}. */
private static ServerSessionMiddleware.Factory factoryWithSession() {
final ServerSessionMiddleware.Factory factory =
new ServerSessionMiddleware.Factory(() -> SESSION_ID);
final ServerSessionMiddleware middleware =
factory.onCallStarted(CALL_INFO, new FlightCallHeaders(), new RequestContextAdapter());
assertFalse(middleware.hasSession());
assertEquals(SESSION_ID, middleware.getSession().id);
return factory;
}

private static ServerSessionMiddleware callWithCookie(
ServerSessionMiddleware.Factory factory, String... cookieHeaders) {
final FlightCallHeaders headers = new FlightCallHeaders();
for (String cookieHeader : cookieHeaders) {
headers.insert("cookie", cookieHeader);
}
return factory.onCallStarted(CALL_INFO, headers, new RequestContextAdapter());
}

@Test
public void sessionCookieAlone() {
final ServerSessionMiddleware.Factory factory = factoryWithSession();
final ServerSessionMiddleware middleware =
callWithCookie(factory, ServerSessionMiddleware.sessionCookieName + "=" + SESSION_ID);
assertTrue(middleware.hasSession());
assertEquals(SESSION_ID, middleware.getSession().id);
}

/** The session cookie is found when other cookies share the header (RFC 6265 "; " list). */
@Test
public void sessionCookieAfterOtherCookies() {
final ServerSessionMiddleware.Factory factory = factoryWithSession();
final ServerSessionMiddleware middleware =
callWithCookie(
factory,
"AWSALB=abc; "
+ ServerSessionMiddleware.sessionCookieName
+ "="
+ SESSION_ID
+ "; x=y");
assertTrue(middleware.hasSession());
assertEquals(SESSION_ID, middleware.getSession().id);
}

/** A cookie value may contain '=' (for example base64 padding). */
@Test
public void sessionCookieValueWithEquals() {
final ServerSessionMiddleware.Factory factory =
new ServerSessionMiddleware.Factory(() -> "c2Vzc2lvbg==");
final ServerSessionMiddleware created =
factory.onCallStarted(CALL_INFO, new FlightCallHeaders(), new RequestContextAdapter());
final ServerSessionMiddleware.Session session = created.getSession();
final ServerSessionMiddleware middleware =
callWithCookie(factory, ServerSessionMiddleware.sessionCookieName + "=c2Vzc2lvbg==");
assertTrue(middleware.hasSession());
assertSame(session, middleware.getSession());
}

/** A malformed entry earlier in the list does not hide the session cookie. */
@Test
public void malformedCookieIsSkipped() {
final ServerSessionMiddleware.Factory factory = factoryWithSession();
final ServerSessionMiddleware middleware =
callWithCookie(
factory, "garbage; " + ServerSessionMiddleware.sessionCookieName + "=" + SESSION_ID);
assertTrue(middleware.hasSession());
assertEquals(SESSION_ID, middleware.getSession().id);
}

@Test
public void quotedSessionCookieValue() {
final ServerSessionMiddleware.Factory factory = factoryWithSession();
final ServerSessionMiddleware middleware =
callWithCookie(
factory, ServerSessionMiddleware.sessionCookieName + "=\"" + SESSION_ID + "\"");
assertTrue(middleware.hasSession());
assertEquals(SESSION_ID, middleware.getSession().id);
}

@Test
public void sessionCookieInSecondHeader() {
final ServerSessionMiddleware.Factory factory = factoryWithSession();
final ServerSessionMiddleware middleware =
callWithCookie(
factory, "other=1", ServerSessionMiddleware.sessionCookieName + "=" + SESSION_ID);
assertTrue(middleware.hasSession());
assertEquals(SESSION_ID, middleware.getSession().id);
}

@Test
public void noSessionCookie() {
final ServerSessionMiddleware.Factory factory = factoryWithSession();
assertFalse(callWithCookie(factory, "other=1; another=2").hasSession());
assertFalse(
callWithCookie(factory, ServerSessionMiddleware.sessionCookieName + "=").hasSession());
}

@Test
public void unknownSessionCookie() {
final ServerSessionMiddleware.Factory factory = factoryWithSession();
final FlightRuntimeException e =
assertThrows(
FlightRuntimeException.class,
() -> callWithCookie(factory, ServerSessionMiddleware.sessionCookieName + "=unknown"));
assertEquals(FlightStatusCode.NOT_FOUND, e.status().code());
}
}
6 changes: 6 additions & 0 deletions flight/flight-sql-jdbc-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,12 @@ under the License.
<artifactId>protobuf-java</artifactId>
</dependency>

<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest</artifactId>
Expand Down
Loading
Loading