-
Notifications
You must be signed in to change notification settings - Fork 227
Description
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