You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried executing a query in BigQuery using this library gogol-bigquery. Please find the following code snippet, QueryRequest and QueryResponse generated. Please let me know why I am getting a Left instead of Right and is there anything missing in Request
txnreport :: ActionM ()
txnreport = do
body <- jsonData :: ActionM HT.Body
-- query <- liftIO $ constructQuery body
let respFn = GT._cliResponse $ executeQuery "a"
eitherVal <- liftIO $ runResourceT $ respFn mempty
html $ T.pack $ show eitherVal
setParams :: QueryRequest -> QueryRequest
setParams qr = qr & (qrLocation .~ (Just "asia-south1")) . (qrUseLegacySQL .~ True) . (qrQuery .~ (Just "select order_id from projectId:dataset.table limit 100"))
executeQuery :: T.Text -> GClient (Rs JobsQuery)
executeQuery query = do
let
qr = queryRequest
modified = setParams qr
in
requestClient $ jobsQuery modified "projectId"
The text was updated successfully, but these errors were encountered:
I tried executing a query in BigQuery using this library gogol-bigquery. Please find the following code snippet, QueryRequest and QueryResponse generated. Please let me know why I am getting a Left instead of Right and is there anything missing in Request
JobsQuery :
JobsQuery' {_jqPayload = QueryRequest' {_qrLocation = Just "asia-south1", _qrUseQueryCache = True, _qrPreserveNulls =
Nothing, _qrKind = "bigquery#queryRequest", _qrQueryParameters = Nothing, _qrQuery = Just "select order_id from
projectId:dataset.tablename limit 100", _qrParameterMode = Nothing, _qrTimeoutMs = Nothing,
_qrUseLegacySQL = True, _qrDryRun = Nothing, _qrMaxResults = Nothing, _qrDefaultDataSet = Nothing}, _jqProjectId =
"projectId"}
Response:
Left ("Error in $: not enough input","")
Code:
txnreport :: ActionM ()
txnreport = do
body <- jsonData :: ActionM HT.Body
-- query <- liftIO $ constructQuery body
let respFn = GT._cliResponse $ executeQuery "a"
eitherVal <- liftIO $ runResourceT $ respFn mempty
html $ T.pack $ show eitherVal
setParams :: QueryRequest -> QueryRequest
setParams qr = qr & (qrLocation .~ (Just "asia-south1")) . (qrUseLegacySQL .~ True) . (qrQuery .~ (Just "select order_id from projectId:dataset.table limit 100"))
executeQuery :: T.Text -> GClient (Rs JobsQuery)
executeQuery query = do
let
qr = queryRequest
modified = setParams qr
in
requestClient $ jobsQuery modified "projectId"
The text was updated successfully, but these errors were encountered: