@@ -39,12 +39,12 @@ data Error
3939 = FromTypeUnsupported (Ir. SelectFromG 'BigQuery Expression )
4040 | NoOrderSpecifiedInOrderBy
4141 | MalformedAgg
42- | FieldTypeUnsupportedForNow (Ir. AnnFieldG 'BigQuery Expression )
43- | AggTypeUnsupportedForNow (Ir. TableAggregateFieldG 'BigQuery Expression )
44- | NodesUnsupportedForNow (Ir. TableAggregateFieldG 'BigQuery Expression )
42+ | FieldTypeUnsupportedForNow (Ir. AnnFieldG 'BigQuery ( Const Void ) Expression )
43+ | AggTypeUnsupportedForNow (Ir. TableAggregateFieldG 'BigQuery ( Const Void ) Expression )
44+ | NodesUnsupportedForNow (Ir. TableAggregateFieldG 'BigQuery ( Const Void ) Expression )
4545 | NoProjectionFields
4646 | NoAggregatesMustBeABug
47- | UnsupportedArraySelect (Ir. ArraySelectG 'BigQuery Expression )
47+ | UnsupportedArraySelect (Ir. ArraySelectG 'BigQuery ( Const Void ) Expression )
4848 | UnsupportedOpExpG (Ir. OpExpG 'BigQuery Expression )
4949 | UnsupportedSQLExp Expression
5050 | UnsupportedDistinctOn
@@ -110,7 +110,7 @@ runFromIr fromIr = evalStateT (unFromIr fromIr) mempty
110110-- single object or an array.
111111mkSQLSelect ::
112112 Rql. JsonAggSelect
113- -> Ir. AnnSelectG 'BigQuery (Ir. AnnFieldsG 'BigQuery Expression ) Expression
113+ -> Ir. AnnSelectG 'BigQuery (Const Void ) ( Ir. AnnFieldsG 'BigQuery ( Const Void ) Expression ) Expression
114114 -> FromIr BigQuery. Select
115115mkSQLSelect jsonAggSelect annSimpleSel = do
116116 select <- fromSelectRows annSimpleSel
@@ -123,7 +123,7 @@ mkSQLSelect jsonAggSelect annSimpleSel = do
123123 })
124124
125125-- | Convert from the IR database query into a select.
126- fromRootField :: Ir. QueryDB 'BigQuery Expression -> FromIr Select
126+ fromRootField :: Ir. QueryDB 'BigQuery ( Const Void ) Expression -> FromIr Select
127127fromRootField =
128128 \ case
129129 (Ir. QDBSingleRow s) -> mkSQLSelect Rql. JASSingleObject s
@@ -134,7 +134,7 @@ fromRootField =
134134--------------------------------------------------------------------------------
135135-- Top-level exported functions
136136
137- fromSelectRows :: Ir. AnnSelectG 'BigQuery (Ir. AnnFieldsG 'BigQuery Expression ) Expression -> FromIr BigQuery. Select
137+ fromSelectRows :: Ir. AnnSelectG 'BigQuery (Const Void ) ( Ir. AnnFieldsG 'BigQuery ( Const Void ) Expression ) Expression -> FromIr BigQuery. Select
138138fromSelectRows annSelectG = do
139139 selectFrom <-
140140 case from of
@@ -186,7 +186,7 @@ fromSelectRows annSelectG = do
186186 else LeaveNumbersAlone
187187
188188fromSelectAggregate ::
189- Ir. AnnSelectG 'BigQuery [(Rql. FieldName , Ir. TableAggregateFieldG 'BigQuery Expression )] Expression
189+ Ir. AnnSelectG 'BigQuery ( Const Void ) [(Rql. FieldName , Ir. TableAggregateFieldG 'BigQuery ( Const Void ) Expression )] Expression
190190 -> FromIr BigQuery. Select
191191fromSelectAggregate annSelectG = do
192192 selectFrom <-
@@ -592,7 +592,7 @@ fromTableAggregateFieldG ::
592592 Args
593593 -> Top
594594 -> StringifyNumbers
595- -> (Rql. FieldName , Ir. TableAggregateFieldG 'BigQuery Expression )
595+ -> (Rql. FieldName , Ir. TableAggregateFieldG 'BigQuery ( Const Void ) Expression )
596596 -> ReaderT EntityAlias FromIr FieldSource
597597fromTableAggregateFieldG args permissionBasedTop stringifyNumbers (Rql. FieldName name, field) =
598598 case field of
@@ -616,7 +616,7 @@ fromTableAggregateFieldG args permissionBasedTop stringifyNumbers (Rql.FieldName
616616 { aliasedThing = BigQuery. ValueExpression (StringValue text)
617617 , aliasedAlias = name
618618 })
619- Ir. TAFNodes _ (fields :: [(Rql. FieldName , Ir. AnnFieldG 'BigQuery Expression )]) -> do
619+ Ir. TAFNodes _ (fields :: [(Rql. FieldName , Ir. AnnFieldG 'BigQuery ( Const Void ) Expression )]) -> do
620620 fieldSources <-
621621 traverse
622622 (fromAnnFieldsG (argsExistingJoins args) stringifyNumbers)
@@ -663,7 +663,7 @@ fromAggregateField aggregateField =
663663fromAnnFieldsG ::
664664 Map TableName EntityAlias
665665 -> StringifyNumbers
666- -> (Rql. FieldName , Ir. AnnFieldG 'BigQuery Expression )
666+ -> (Rql. FieldName , Ir. AnnFieldG 'BigQuery ( Const Void ) Expression )
667667 -> ReaderT EntityAlias FromIr FieldSource
668668fromAnnFieldsG existingJoins stringifyNumbers (Rql. FieldName name, field) =
669669 case field of
@@ -698,6 +698,9 @@ fromAnnFieldsG existingJoins stringifyNumbers (Rql.FieldName name, field) =
698698 { aliasedThing = BigQuery. ValueExpression (StringValue " null: remote field selected" )
699699 , aliasedAlias = name
700700 })
701+ -- TODO: implement this
702+ Ir. AFDBRemote _ -> error " FIXME"
703+
701704
702705-- | Here is where we project a field as a column expression. If
703706-- number stringification is on, then we wrap it in a
@@ -840,7 +843,7 @@ fieldSourceJoin =
840843-- See also 'fromArrayRelationSelectG' for similar example.
841844fromObjectRelationSelectG ::
842845 Map TableName EntityAlias
843- -> Ir. ObjectRelationSelectG 'BigQuery Expression
846+ -> Ir. ObjectRelationSelectG 'BigQuery ( Const Void ) Expression
844847 -> ReaderT EntityAlias FromIr Join
845848-- We're not using existingJoins at the moment, which was used to
846849-- avoid re-joining on the same table twice.
@@ -900,13 +903,13 @@ fromObjectRelationSelectG _existingJoins annRelationSelectG = do
900903 , joinExtractPath = Nothing
901904 }
902905 where
903- Ir. AnnObjectSelectG { _aosFields = fields :: Ir. AnnFieldsG 'BigQuery Expression
906+ Ir. AnnObjectSelectG { _aosFields = fields :: Ir. AnnFieldsG 'BigQuery ( Const Void ) Expression
904907 , _aosTableFrom = tableFrom :: TableName
905908 , _aosTableFilter = tableFilter :: Ir. AnnBoolExp 'BigQuery Expression
906909 } = annObjectSelectG
907910 Ir. AnnRelationSelectG { aarRelationshipName
908911 , aarColumnMapping = mapping :: HashMap ColumnName ColumnName
909- , aarAnnSelect = annObjectSelectG :: Ir. AnnObjectSelectG 'BigQuery Expression
912+ , aarAnnSelect = annObjectSelectG :: Ir. AnnObjectSelectG 'BigQuery ( Const Void ) Expression
910913 } = annRelationSelectG
911914
912915-- We're not using existingJoins at the moment, which was used to
@@ -920,7 +923,7 @@ _lookupTableFrom existingJoins tableFrom = do
920923 Just entityAlias -> pure (Left entityAlias)
921924 Nothing -> fmap Right (fromQualifiedTable tableFrom)
922925
923- fromArraySelectG :: Ir. ArraySelectG 'BigQuery Expression -> ReaderT EntityAlias FromIr Join
926+ fromArraySelectG :: Ir. ArraySelectG 'BigQuery ( Const Void ) Expression -> ReaderT EntityAlias FromIr Join
924927fromArraySelectG =
925928 \ case
926929 Ir. ASSimple arrayRelationSelectG ->
@@ -935,7 +938,7 @@ fromArraySelectG =
935938--
936939-- See also 'fromArrayRelationSelectG' for similar example.
937940fromArrayAggregateSelectG ::
938- Ir. AnnRelationSelectG 'BigQuery (Ir. AnnAggregateSelectG 'BigQuery Expression )
941+ Ir. AnnRelationSelectG 'BigQuery (Ir. AnnAggregateSelectG 'BigQuery ( Const Void ) Expression )
939942 -> ReaderT EntityAlias FromIr Join
940943fromArrayAggregateSelectG annRelationSelectG = do
941944 joinFieldName <- lift (fromRelName aarRelationshipName)
@@ -1040,7 +1043,7 @@ fromArrayAggregateSelectG annRelationSelectG = do
10401043-- ^ Ordering for the artist table should appear here.
10411044
10421045fromArrayRelationSelectG ::
1043- Ir. ArrayRelationSelectG 'BigQuery Expression
1046+ Ir. ArrayRelationSelectG 'BigQuery ( Const Void ) Expression
10441047 -> ReaderT EntityAlias FromIr Join
10451048fromArrayRelationSelectG annRelationSelectG = do
10461049 select <- lift (fromSelectRows annSelectG) -- Take the original select.
@@ -1328,7 +1331,7 @@ fromAlias :: From -> EntityAlias
13281331fromAlias (FromQualifiedTable Aliased {aliasedAlias}) = EntityAlias aliasedAlias
13291332fromAlias (FromSelect Aliased {aliasedAlias}) = EntityAlias aliasedAlias
13301333
1331- fieldTextNames :: Ir. AnnFieldsG 'BigQuery Expression -> [Text ]
1334+ fieldTextNames :: Ir. AnnFieldsG 'BigQuery ( Const Void ) Expression -> [Text ]
13321335fieldTextNames = fmap (\ (Rql. FieldName name, _) -> name)
13331336
13341337unEntityAlias :: EntityAlias -> Text
0 commit comments