Skip to content

Fixed markDeletedTables for bigquery - #4930

Merged
pmbrull merged 1 commit into
open-metadata:mainfrom
OnkarVO7:ISSUE-4925
May 13, 2022
Merged

pmbrull merged 1 commit into
open-metadata:mainfrom
OnkarVO7:ISSUE-4925

Conversation

@OnkarVO7

Copy link
Copy Markdown
Contributor

Describe your changes :

Fix #4925

Type of change :

  • Bug fix

Checklist:

  • I have read the CONTRIBUTING document.
  • I have commented on my code, particularly in hard-to-understand areas.
  • I have added tests that prove my fix is effective or that my feature works.
  • All new and existing tests passed.

Reviewers

@open-metadata/ingestion

@OnkarVO7
OnkarVO7 temporarily deployed to cypress May 13, 2022 10:16 Inactive
@OnkarVO7
OnkarVO7 temporarily deployed to cypress May 13, 2022 10:16 Inactive
@OnkarVO7
OnkarVO7 temporarily deployed to cypress May 13, 2022 10:16 Inactive
@OnkarVO7
OnkarVO7 temporarily deployed to cypress May 13, 2022 10:16 Inactive
@sonarqubecloud

Copy link
Copy Markdown

[open-metadata-ingestion] Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

0.0% 0.0% Coverage
57.1% 57.1% Duplication

@pmbrull
pmbrull merged commit 4ef1f4b into open-metadata:main May 13, 2022
mohityadav766 added a commit that referenced this pull request Jul 10, 2026
The retry halved the raw (uncapped) input while buildRequest re-capped every
attempt, so any input >16384 chars resent byte-identical payloads and never
converged (#4930 persisted for the token-dense case). Cap once up front so
halving operates on what is actually sent, and:

- detect token overflow via typed ValidationException + a named marker constant,
  so throttling/auth/other validation errors are never retried
- make halveInput empty-safe and surrogate-pair-safe (emoji path)
- split the retry decision into a plain requireRetryable guard (clearer loop)
- reuse StringUtils.truncate for the char cap
- cover the retry loop, classifier, and budget exhaustion with mock-based tests

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
mohityadav766 added a commit that referenced this pull request Jul 13, 2026
…eption (#29920)

* Fixes #4930: cap Titan Bedrock embedding input to avoid ValidationException

Titan text-embedding models accept at most 8192 input tokens and expose no
request-side truncate directive, so oversized chunks were rejected by Bedrock
with a ValidationException. The Cohere family already capped its input
client-side; generalize that cap so Titan V1/V2 also truncate oversized input.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* Retry with precise truncation when Bedrock reports a token-limit overflow

The 16384-char cap keeps typical English input to one call but can still be
exceeded by token-dense scripts (CJK, emoji) where chars approx tokens. On a
token-limit ValidationException, parse the reported max/actual token counts,
truncate the input to fit, and retry — a content-agnostic guarantee the char
cap alone cannot provide.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* Simplify token-overflow retry: halve input instead of parsing error counts

Parsing the exact token counts out of AWS's error message is fragile and buys
little: the char cap already bounds input, so halving converges in ~2 retries.
Keep only the message-based detection (AWS gives no machine-readable code for
token overflow) and drop the two regexes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* Fix retry no-op: cap input up front, plus review follow-ups

The retry halved the raw (uncapped) input while buildRequest re-capped every
attempt, so any input >16384 chars resent byte-identical payloads and never
converged (#4930 persisted for the token-dense case). Cap once up front so
halving operates on what is actually sent, and:

- detect token overflow via typed ValidationException + a named marker constant,
  so throttling/auth/other validation errors are never retried
- make halveInput empty-safe and surrogate-pair-safe (emoji path)
- split the retry decision into a plain requireRetryable guard (clearer loop)
- reuse StringUtils.truncate for the char cap
- cover the retry loop, classifier, and budget exhaustion with mock-based tests

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
mohityadav766 added a commit that referenced this pull request Jul 14, 2026
…eption (#29920) (#30021)

Backport of #29920 to 1.13.

Titan text-embedding models accept at most 8192 input tokens and expose no
request-side truncate directive, so oversized chunks were rejected by Bedrock
with a ValidationException. Cap the input at 16384 chars up front, and on a
token-limit ValidationException halve the (already capped) input and retry —
a content-agnostic guarantee the char cap alone cannot provide for token-dense
scripts (CJK, emoji).

Adapted from the original: 1.13's BedrockEmbeddingClient predates the
embedding-family refactor (Cohere support, doEmbedQuery, per-family request
builders), so the fix is applied to the Titan-only shape that exists here.
The family/Cohere portions of the upstream change and its tests are omitted.

(cherry picked from commit 86909c4)

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

This branch was previously deployed

1 inactive deployment
cypress — 2e8e625f Deployed May 13, 2022 by OnkarVO7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

markDeletedTables not working for bigquery

3 participants