toddmeng-db commented on code in PR #3217:
URL: https://github.com/apache/arrow-adbc/pull/3217#discussion_r2243551863
##########
csharp/src/Drivers/Apache/Hive2/HiveServer2Statement.cs:
##########
@@ -726,20 +738,15 @@ protected internal QueryResult
EnhanceGetColumnsResult(Schema originalSchema, IR
protected virtual async Task<QueryResult>
GetColumnsExtendedAsync(CancellationToken cancellationToken = default)
{
- // 1. Get all three results at once
+ // 1. Get columns result and read all data immediately
var columnsResult = await GetColumnsAsync(cancellationToken);
if (columnsResult.Stream == null)
{
// TODO: Add log or throw
return columnsResult;
}
- var pkResult = await GetPrimaryKeysAsync(cancellationToken);
-
- // For FK lookup, we need to pass in the current
catalog/schema/table as the foreign table
- var fkResult = await
GetCrossReferenceAsForeignTableAsync(cancellationToken);
-
Review Comment:
I think this could be more performant if we called await on the Tasks
returned by GetPrimaryKeysAsync or GetCrossReferenceAsForeignTableAsync later
on in the flow. This PR will force these calls to occur sequentially, though.
##########
csharp/src/Drivers/Apache/Hive2/HiveServer2Statement.cs:
##########
@@ -726,20 +740,15 @@ protected internal QueryResult
EnhanceGetColumnsResult(Schema originalSchema, IR
protected virtual async Task<QueryResult>
GetColumnsExtendedAsync(CancellationToken cancellationToken = default)
{
- // 1. Get all three results at once
+ // 1. Get columns result and read all data immediately
var columnsResult = await GetColumnsAsync(cancellationToken);
if (columnsResult.Stream == null)
{
// TODO: Add log or throw
return columnsResult;
}
Review Comment:
I think this could be more performant if we called await on the Tasks
returned by GetPrimaryKeysAsync or GetCrossReferenceAsForeignTableAsync later
on in the flow. This PR will force these calls to occur sequentially, though.
##########
csharp/src/Drivers/Apache/Hive2/HiveServer2Statement.cs:
##########
@@ -726,20 +738,15 @@ protected internal QueryResult
EnhanceGetColumnsResult(Schema originalSchema, IR
protected virtual async Task<QueryResult>
GetColumnsExtendedAsync(CancellationToken cancellationToken = default)
{
- // 1. Get all three results at once
+ // 1. Get columns result and read all data immediately
var columnsResult = await GetColumnsAsync(cancellationToken);
if (columnsResult.Stream == null)
{
// TODO: Add log or throw
return columnsResult;
}
- var pkResult = await GetPrimaryKeysAsync(cancellationToken);
-
- // For FK lookup, we need to pass in the current
catalog/schema/table as the foreign table
- var fkResult = await
GetCrossReferenceAsForeignTableAsync(cancellationToken);
-
Review Comment:
I think this could be more performant if we called await on the Tasks
returned by GetPrimaryKeysAsync or GetCrossReferenceAsForeignTableAsync later
on in the flow. This PR will force these calls to occur sequentially, though.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]