Skip to content

Commit a870e7a

Browse files
author
peco-engineer-bot[bot]
committed
learn: retrospective learnings
Signed-off-by: peco-engineer-bot[bot] <peco-engineer-bot[bot]@users.noreply.github.com>
1 parent c9a051d commit a870e7a

2 files changed

Lines changed: 17 additions & 3 deletions

File tree

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Learning journal 2026-12-02
2+
3+
### 2026-12-02: Thrift/kernel parity — Thrift reports a placeholder `Result STRING` schema for statements without output
4+
**Context:** In PR #651, Thrift returned a placeholder TTableSchema column (`Result STRING`) for DDL, while the Arrow schema in the same response had no fields and kernel reported `{ columns: [] }`. The fix normalizes the schema only when the Arrow metadata confirms there are no fields. The deprecated wire accessor `getMetadata()` stays unchanged, and without Arrow metadata the placeholder is kept because it can't be told apart from a real `Result` column.
5+
**Rule:** Detect Thrift no-output statements from an empty Arrow schema rather than from the `Result STRING` TTableSchema placeholder, normalize once into a separate cached copy, and leave raw wire accessors such as getMetadata() verbatim.
6+
7+
### 2026-12-02: Result handlers — Result providers must terminate on an empty column schema
8+
**Context:** In PR #651, `fetchAll()` and `fetchChunk()` hung on column-based Thrift results whose schema was empty or missing, because JsonResultHandler.hasMore() kept asking the source for more rows. The fix returns false early when there are zero columns, and the tests check the fetchResults call count and that hasMoreRows() is false.
9+
**Rule:** When a schema can become empty, make every result handler's hasMore() return false for zero columns, and test fetchAll and fetchChunk for termination and for a bounded number of fetchResults calls.

‎.claude/knowledge/lessons.md‎

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Lessons
22

3-
<!-- distilled-through: 2026-11-18 -->
3+
<!-- distilled-through: 2026-12-02 -->
44

55
## Configuration and authentication
66
- L-0001 (3×, #457): Trace option support through DBSQLClient, auth adapters and each transport. Type declarations and class comments do not establish forwarding; shared preparation can precede backend-specific filtering.
@@ -12,7 +12,7 @@
1212
- L-0007 (1×, #509): Verify native capabilities against generated declarations and shipped bindings. Do not assert unobservable published-binary behavior from connector source alone.
1313
- L-0008 (1×, #506): Resolve runtime telemetry identity identically on both backends, including POSIX locale precedence LC_ALL, LC_MESSAGES, then LANG.
1414
- L-0009 (1×, #506): Verify omitted/default branches are reachable; upstream default injection may prevent native defaults from ever taking effect.
15-
- L-0010 (1×, #519): Kernel requires nondefault ports embedded in host; a separate port option is forwarded only by Thrift.
15+
- L-0010 (2×, #636 #519): Forward port to kernel with Thrift semantics: falsy/NaN means omitted (port || default), default from effective scheme (80 for https:false or http://), host-embedded port wins, and non-numeric values throw ParameterError in TypeScript.
1616
- L-0011 (1×, #528): Empty metadata filters have method/backend-specific semantics. Normalize empty catalog to undefined only where wildcard behavior is intended and verified.
1717
- L-0012 (1×, #533): Required string validation must distinguish non-string values from legitimate empty strings.
1818
- L-0013 (1×, #536): Metadata rewrites must preserve server values for omitted/wildcard request patterns rather than stamping the request pattern onto every row.
@@ -27,7 +27,7 @@
2727
- L-0022 (1×, #588): Match host/URL normalization across backends for slashes, embedded ports and IPv6; compare edge cases on both before changing either.
2828

2929
## Native packages and public compatibility
30-
- L-0023 (4×, #505 #513 #514): New native fields need published binding support. Land router capability/version checks and all platform optionalDependency pins together; source-only KERNEL_REV bumps or accepted TypeScript fields do not ship support.
30+
- L-0023 (5×, #636 #514 #513): New native fields need published binding support. Land capability checks with all platform optionalDependency pins and lockfile; keep driver-side fallbacks until then. Source-only KERNEL_REV bumps or accepted TypeScript fields do not ship support.
3131
- L-0024 (2×, #514 #506 #528): Regenerate native index.d.ts from the pinned build and review its contract changes. Mocked JS tests cannot verify ABI behavior or live-server compatibility.
3232
- L-0025 (1×, #514): Changelog entries for source-only native features must state the required follow-up published package bump and reference the kernel change.
3333
- L-0026 (3×, #516 #522 #538): Public package-lock resolved URLs must use registry.npmjs.org after internal-mirror installs; integrity hashes remain content-addressed.
@@ -78,3 +78,8 @@
7878
- L-0065 (1×, #566): Build after installs that omit prepare so generated lib/version.ts exists before tests/type checks.
7979
- L-0066 (1×, #566 #562): Serialize branch-editing bot flows with one per-PR concurrency group and restore dependency-setup lockfile rewrites before agent edits.
8080
- L-0067 (1×, #621 #620): GitHub Actions expressions allow hyphens in dot-dereferenced names; do not flag or rewrite `${{ inputs.some-name }}` as subtraction.
81+
- L-0085 (1×, #654): CI building the native binding from KERNEL_REV must assert the napi router's exports are identical to the locally built .node module's, so fallback to a published platform package cannot pass.
82+
83+
## Result handling
84+
- L-0086 (1×, #651): Detect Thrift no-output statements from an empty Arrow schema, not the `Result STRING` TTableSchema placeholder; normalize into a separate cached copy and leave raw accessors like getMetadata() verbatim.
85+
- L-0087 (1×, #651): Every result handler's hasMore() must return false for zero-column schemas; test fetchAll and fetchChunk for termination and a bounded fetchResults call count.

0 commit comments

Comments
 (0)