Can you serialize the schema by creating an IPC file with zero record
batches?  I apologize, but I do not know the JS API as well.  Maybe
you can create a table from just a schema (or a schema and a set of
empty arrays) and then turn that into an IPC file?  This shouldn't add
too much overhead.

On Thu, May 5, 2022 at 8:23 AM Howard Engelhart
<[email protected]> wrote:
>
> I'm looking to implement an Athena federated query custom connector using the 
> arrow js lib.  I'm getting stuck on figuring out how to encode a Schema 
> properly for the Athena GetTableResponse.  I have found an example using 
> python that does something like this.. (paraphrasing...)
>
> import pyarrow as pa
> .....
>        return {
>             "@type": "GetTableResponse",
>             "catalogName": self.catalogName,
>             "tableName": {'schemaName': self.databaseName, 'tableName': 
> self.tableName},
>             "schema": {"schema": 
> base64.b64encode(pa.schema(....args...).serialize().slice(4)).decode("utf-8")},
>             "partitionColumns": self.partitions,
>             "requestType": self.request_type
>         }
> What i'm looking for is the js equivalent of
> pa.schema(....args...).serialize()
>
> Is there one?  If not, could someone point me in the right direction of how 
> to code up something similar?

Reply via email to