You can look at the example: 
https://github.com/apache/arrow/blob/45918a90a6ca1cf3fd67c256a7d6a240249e555a/java/flight/flight-sql/src/test/java/org/apache/arrow/flight/sql/example/FlightSqlExample.java#L632-L641

getSchema is about the schema of an Arrow dataset, not database catalog/schema 
metadata. The same goes for the dataset here.

On Tue, Feb 21, 2023, at 05:35, Derek Wang wrote:
> Hi David,
> 
> Thanks for your reply. Sorry that my question is not clear.  I'm still 
> leraning flight SQL. I implemented SpartaFlightSqlProducer and overwrite 
> createPreparedStatement. I'm using the following method to build a 
> ActionCreatePreparedStatementResult.
> 
> I don't know how do I set parameter schema and dataset schema here. Also, 
> when I start the flight server, I didn't configure the database schema. How 
> does flight server know what schema to return if client calls getSchema 
> method.
> 
>     val result = ActionCreatePreparedStatementResult.newBuilder
>       .setPreparedStatementHandle(preparedStatementHandle)
>       //TODO: Default implementations, need to look at parameter binding for 
> prepares statements
>       .setParameterSchema(ByteString.EMPTY)
>       .setDatasetSchema(ByteString.EMPTY)
>       .setUnknownFields(UnknownFieldSet.getDefaultInstance)
>       .build
> 
> Regards,
> Dafei
> 
> On Thu, Feb 16, 2023 at 8:11 PM David Li <[email protected]> wrote:
>> __
>> Hi Derek,
>> 
>> Is this Flight RPC, or Flight SQL?
>> 
>> Also, I assume you are talking about the metadata schema, not an Arrow 
>> schema, right?
>> 
>> For Flight RPC, there is no standard.
>> 
>> For Flight SQL, there is a proposal starting here for catalogs, which may 
>> work: https://lists.apache.org/thread/fd6r1n7vt91sg2c7fr35wcrsqz6x4645
>> 
>> Any details about what specifically you're trying to accomplish would be 
>> helpful.
>> 
>> -David
>> 
>> On Thu, Feb 16, 2023, at 14:18, Derek Wang wrote:
>>> Dear Sir/Madam,
>>> 
>>> I'm integrating our DB with flight service. How do I set db schema in a 
>>> flight service?
>>> 
>>> Regards,
>>> Derek
>> 

Reply via email to