-
-
Notifications
You must be signed in to change notification settings - Fork 150
Open
Recidiviz/go-zetasqlite
#59Labels
bugSomething isn't workingSomething isn't working
Description
What happened?
The following test fails
def "use Job.getQueryResults with TO_JSON_STRING"() {
given:
QueryJobConfiguration queryJobConfiguration = QueryJobConfiguration
.newBuilder("SELECT TO_JSON_STRING(t,true) from (SELECT * FROM dataset.table) as t")
.build()
JobId jobId = JobId.newBuilder().setProject(project).setRandomJob().build()
Job job = bigQuery.create(JobInfo.newBuilder(queryJobConfiguration)
.setJobId(jobId)
.build())
when:
TableResult tableResult = job.getQueryResults()
List<Map> results = tableResult.streamAll().map(f ->
objectMapper.readValue(f[0].value.toString(), Map)
).toList()
then:
results.size() == 2
}This is because DATE field value is missing quotes:
{"id":1,"name":"alice","dob":1990-01-01}Note. Date field value is missing quotes. Works as expected in real BQ.
What did you expect to happen?
Date field in the JSON should be quoted.
How can we reproduce it (as minimally and precisely as possible)?
git clone -b feature/TO_JSON_STRING [email protected]:pavelfomin/spring-boot-bq-example.git
./gradlew clean buildAnything else we need to know?
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working