Skip to content

Conversation

@linzhou-db
Copy link
Collaborator

@linzhou-db linzhou-db commented Oct 7, 2024

Only Check includeEndStreamAction in response header when needed:

  • for sync queryTable and queryTableChanges,
  • not for async queries and getTableVersion and getTableMetadata

s"/shares/$encodedShareName/schemas/$encodedSchemaName/tables/$encodedTableName/metadata" +
s"$encodedParams")
val response = getNDJson(target)
val response = getNDJson(target, requireVersion = true, checkEndStreamActionHeader = false)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: do we set includeendstreamaction for metadata queries?
If do, would it be a problem if some DS server returns endStreamAction for it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense, updated to not set includeendstreamaction for table version and metadata queries.

@linzhou-db linzhou-db requested a review from chakankardb October 8, 2024 05:50
} else {
val response = getNDJson(target, request)
val response = getNDJsonPost(
target = target, data = request, setIncludeEndStreamAction = true
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(optional, for my readability)
consider renaming: includeEndStreamAction -> endStreamActionEnabled
We can then setIncludeEndStreamAction = endStreamActionEnabled where we are setting it to true, and then at other places only test for setIncludeEndStreamAction.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you mean the renaming of the header or variable name?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The variable name @linzhou-db

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

@linzhou-db linzhou-db requested a review from chakankardb October 8, 2024 22:04
},
respondedFormat = respondedFormat,
includeEndStreamActionHeader = includeEndStreamActionHeader,
respondedFormat = getRespondedFormat(capabilities),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optional optimization:
Can getResponse itself create the capabilitesMap to avoid duplicate parsing and map creation from capabilities, since it seems the capabilities map is what is used everywhere?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated.

@linzhou-db linzhou-db merged commit f88f9aa into main Oct 9, 2024
10 checks passed
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.

2 participants