# Encounter pyarrow Invalid Parameter Error When Creating View Using Dremio Flight Endpoint

**URL:** https://community.dremio.com/t/encounter-pyarrow-invalid-parameter-error-when-creating-view-using-dremio-flight-endpoint/11523
**Category:** Dremio University
**Created:** [February 21, 2024, 5:57am UTC](https://community.dremio.com/t/encounter-pyarrow-invalid-parameter-error-when-creating-view-using-dremio-flight-endpoint/11523 "2024-02-21T05:57:51Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Han-lai](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/han-lai/32/5481_2.png) [@Han-lai](https://community.dremio.com/u/Han-lai)
#### Post date: [February 21, 2024, 5:57am UTC](https://community.dremio.com/t/encounter-pyarrow-invalid-parameter-error-when-creating-view-using-dremio-flight-endpoint/11523/1 "2024-02-21T05:57:51Z")

</div>

I’m utilizing Dremio Flight Endpoint in Python to execute TPCH SQL queries and create a view in Dremio. However, each attempt results in the following error message:  
python

```auto
from dremio.arguments.parse import get_config
from dremio.flight.endpoint import DremioFlightEndpoint
import os

if __name__ == " __main__":
    # Parse the config file.
    args = get_config()
    sql_query = read_sql_from_file(sql_file)
    # Set the query in args
    args['query'] = sql_query
    # print(args)
    # Instantiate DremioFlightEndpoint object with updated query
    dremio_flight_endpoint = DremioFlightEndpoint(args)

     flight_client = dremio_flight_endpoint.connect()
     # print(dremio_flight_endpoint)
     # Get reader
     reader = dremio_flight_endpoint.get_reader(flight_client)

     # Print out the data as a dataframe
     df = reader.read_pandas()
     print(f"Data from {sql_file}:")
     print(df)

```

sql

```auto
create view "poc".tpch.revenue0 as
        select
                l_suppkey as supplier_no ,
                sum(l_extendedprice * (1 - l_discount)) as total_revenue
        from
                lineitem
        where
                l_shipdate >= date '1995-02-01'
                and l_shipdate < date '1995-02-01' + interval '3' month
        group by
                l_suppkey;

```

```auto
pyarrow.lib.ArrowInvalid: Flight returned invalid argument error, with message: Validation of view sql failed. null

```

 ![image](https://us1.discourse-cdn.com/flex020/uploads/dremio/original/2X/1/1fad262896bee1c64d672411c976bd7f4a2a58c2.png)

I’ve ensured that the submitted SQL query statements comply with Dremio’s syntax requirements, yet the view creation still fails. I’ve also inspected communication with the Dremio server, but haven’t identified any apparent issues.

 ![image](https://us1.discourse-cdn.com/flex020/uploads/dremio/original/2X/0/08ac7702f2de8791bef78e651a7d2aba0a3ec5c6.png)

UI surface :

 ![image](https://us1.discourse-cdn.com/flex020/uploads/dremio/original/2X/7/76b650133e4e2ebcb33be5f6bf8682454ec3913b.jpeg)

It’s worth noting that the same SQL queries executed successfully in the Dremio UI interface, and the view was created without any problems.

I’m reaching out here to see if anyone has encountered a similar issue or if anyone can provide further guidance to resolve this problem. Are there any additional details or solutions regarding this error? Thank you!

---

<div class="post-metadata">

### Author: ![isha](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/isha/32/2883_2.png) [@isha](https://community.dremio.com/u/isha)
#### Post date: [February 21, 2024, 3:12pm UTC](https://community.dremio.com/t/encounter-pyarrow-invalid-parameter-error-when-creating-view-using-dremio-flight-endpoint/11523/2 "2024-02-21T15:12:17Z")

</div>

@Han-lai What version of Dremio are you using?

---

<div class="post-metadata">

### Author: ![Han-lai](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/han-lai/32/5481_2.png) [@Han-lai](https://community.dremio.com/u/Han-lai)
#### Post date: [February 21, 2024, 3:43pm UTC](https://community.dremio.com/t/encounter-pyarrow-invalid-parameter-error-when-creating-view-using-dremio-flight-endpoint/11523/3 "2024-02-21T15:43:23Z")

</div>

dremio/dremio-oss:24.3.0

---

<div class="post-metadata">

### Author: ![Han-lai](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/han-lai/32/5481_2.png) [@Han-lai](https://community.dremio.com/u/Han-lai)
#### Post date: [February 22, 2024, 7:01am UTC](https://community.dremio.com/t/encounter-pyarrow-invalid-parameter-error-when-creating-view-using-dremio-flight-endpoint/11523/4 "2024-02-22T07:01:29Z")

</div>

The issue I encountered is indeed identical to the error code mentioned in your post. I encountered the problem while using the DremioFlightEndpoint interface. Thank you for bringing this to my attention. Could you please clarify if there are any limitations regarding JDBC or ODBC interfaces, such as any restrictions on creating views when using DremioFlightEndpoint?"

and the same error in odbc like this : [Error when create view using odbc Flight - Dremio](https://community.dremio.com/t/error-when-create-view-using-odbc-flight/11283/2)

This is the ADBC interface I created based on the documentation I referred to. : [arrow-flight-client-examples/python at main · dremio-hub/arrow-flight-client-examples (github.com)](https://github.com/dremio-hub/arrow-flight-client-examples/tree/main/python)

---

<div class="post-metadata">

### Author: ![isha](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/isha/32/2883_2.png) [@isha](https://community.dremio.com/u/isha)
#### Post date: [February 22, 2024, 3:46pm UTC](https://community.dremio.com/t/encounter-pyarrow-invalid-parameter-error-when-creating-view-using-dremio-flight-endpoint/11523/5 "2024-02-22T15:46:23Z")

</div>

This is a known issue with 24.3 that is being addressed in the next version.
