HackPoint commented on PR #44783:
URL: https://github.com/apache/arrow/pull/44783#issuecomment-3096746066

   
   
   
   > One thing I didn't do was to resolve the question of the unused 
`_dataSetSchema` and `_parameterSchema` fields on `PreparedStatement`. Work is 
being done to populate these, but they are never used. I started removing them 
but then realized that I don't really understand the difference between these 
and the `GetSchemaAsync` call on the same class. Can you take another look and 
decide what you think should be done about this?
   
   After reviewing the C++ implementation (client.h / PreparedStatement), I 
confirmed that:
   ```cpp
   std::shared_ptr<Schema> parameter_schema() const { return parameter_schema_; 
}
   std::shared_ptr<Schema> dataset_schema() const { return dataset_schema_; }
   ```
   source: `[client.h / PreparedStatement]`
   
   These schemas are accessed directly by consumers after creating the prepared 
statement, allowing them to inspect the expected input/output without making 
additional calls.
   
   In contrast, `GetSchemaAsync()` in C# makes a separate server call to 
retrieve the schema again — which may be redundant if we already have it.
   
   So I made the design decision to expose both schemas as public, readonly 
properties:
   ```csharp
       public Schema DatasetSchema { get; }
       public Schema ParameterSchema { get; }
   ```
   This aligns with the C++ API and gives clients immediate access to the known 
schemas without having to re-fetch them. If schema refresh is ever required, 
they can still call `GetSchemaAsync()` manually.
   
   


-- 
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: github-unsubscr...@arrow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to