The mapping equivalent of this fails due to the dynamic schema on J.
typeside T = literal {
imports sql
external_functions
stringToDouble : String -> Double =
"x => { if (x.isEmpty()) { return x } else { return java.util.Optional.of(java.lang.Double.parseDouble(x.get())) } }"
}
instance J = import_csv "/Users/ryan/Downloads/QualInsp" : T
schema D = literal : T {
entities
QualInsp
attributes
inspNo : QualInsp -> String
mGeomAcc : QualInsp -> Double
}
query Q = literal : schemaOf J -> D {
entity
QualInsp -> {from x:QualInsp
attributes
inspNo -> x.inspNo
mGeomAcc -> stringToDouble(x.mGeomAcc)}
}
instance Result = eval Q J
The mapping equivalent of this fails due to the dynamic schema on J.
typeside T = literal {
imports sql
external_functions
stringToDouble : String -> Double =
"x => { if (x.isEmpty()) { return x } else { return java.util.Optional.of(java.lang.Double.parseDouble(x.get())) } }"
}
instance J = import_csv "/Users/ryan/Downloads/QualInsp" : T
schema D = literal : T {
entities
QualInsp
attributes
inspNo : QualInsp -> String
mGeomAcc : QualInsp -> Double
}
query Q = literal : schemaOf J -> D {
entity
QualInsp -> {from x:QualInsp
attributes
inspNo -> x.inspNo
mGeomAcc -> stringToDouble(x.mGeomAcc)}
}
instance Result = eval Q J