Skip to content

Query Generation Issue #280

@OpenDataAlex

Description

@OpenDataAlex

I'm attempting to build a GraphQL API with Hive as part of the backend. Following the documentation I created the following schema:

`class Manufacturer(SQLAlchemyObjectType):
class Meta:
model = ManufacturerModel
interfaces = (relay.Node,)

class Query(ObjectType):
node = relay.Node.Field()
all_manufacturers = SQLAlchemyConnectionField(Manufacturer.connection)`

Which leverages the following SQLAlchemy model:

`class Manufacturer(Base):

tablename = 'manufacturer_hub'

manufacturer_hub_pk = Column(String, primary_key=True)
manufacturer_name = Column(String)`

I'm able to connect to the Hive cluster and a query attempts to run, but it fails due to the sort that is provided:

SELECT manufacturer_hub.manufacturer_hub_pk AS manufacturer_hub_manufacturer_hub_pk, manufacturer_hub.manufacturer_name AS manufacturer_hub_manufacturer_name FROM manufacturer_hub ORDER BY manufacturer_hub.manufacturer_hub_pk ASC

If aliases are being provided for columns, Hive is expecting them to be used in the ORDER BY. Running the following corrected query in Hive works:

SELECT manufacturer_hub.manufacturer_hub_pk AS manufacturer_hub_manufacturer_hub_pk, manufacturer_hub.manufacturer_name AS manufacturer_hub_manufacturer_name FROM manufacturer_hub ORDER BY manufacturer_hub_manufacturer_hub_pk ASC

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions