ryan-syed commented on code in PR #1884:
URL: https://github.com/apache/arrow-adbc/pull/1884#discussion_r1617974369


##########
csharp/src/Drivers/Apache/Spark/SparkConnection.cs:
##########
@@ -402,23 +561,22 @@ public override IArrowArrayStream 
GetObjects(GetObjectsDepth depth, string? cata
                 {
                     throw new Exception(getTablesResp.Status.ErrorMessage);
                 }
+
+                IReadOnlyDictionary<string, int> columnMap = 
GetColumnIndexMap(getTablesResp.DirectResults.ResultSetMetadata.Schema.Columns);
                 TRowSet resp = getTablesResp.DirectResults.ResultSet.Results;
 
-                IReadOnlyList<string> catalogList = 
resp.Columns[0].StringVal.Values;
-                IReadOnlyList<string> schemaList = 
resp.Columns[1].StringVal.Values;
-                IReadOnlyList<string> tableList = 
resp.Columns[2].StringVal.Values;
-                IReadOnlyList<string> tableTypeList = 
resp.Columns[3].StringVal.Values;
+                IReadOnlyList<string> catalogList = 
resp.Columns[columnMap["TABLE_CAT"]].StringVal.Values;

Review Comment:
   Consider creating string constants for columnMap keys.



-- 
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]

Reply via email to