Skip to content

Instantly share code, notes, and snippets.

@EncodePanda
Created November 24, 2017 14:32
Show Gist options
  • Select an option

  • Save EncodePanda/31303cd27ff5c93fab2763a7a93a7cf9 to your computer and use it in GitHub Desktop.

Select an option

Save EncodePanda/31303cd27ff5c93fab2763a7a93a7cf9 to your computer and use it in GitHub Desktop.

CompileQuery

DirPath

/hdfs/workspaces/a.slam/

Vars

(fromFoldable [])

SQL²

SELECT DISTINCT (state) FROM `/hdfs/patients3.ldjson` ORDER BY state ASC

ReadQuery

DirPath

/hdfs/workspaces/a.slam/

Vars

(fromFoldable [])

Pagination

None

SQL²

SELECT DISTINCT (state) FROM `/hdfs/patients3.ldjson` ORDER BY state ASC

UpdateMount

Path

/hdfs/workspaces/a.slam/.tmp/outfae59abe-799a-44e4-ae8d-86503c55b948/

MountType

Module

SQL²

CREATE FUNCTION cardfae59abe799a44e4ae8d86503c55b948(:minage, :gender, :maxage, :state) BEGIN SELECT * FROM `/hdfs/patients3.ldjson` WHERE state = :state AND (CASE :gender WHEN "male" THEN gender = "male" WHEN "female" THEN gender = "female" WHEN "both" THEN gender IN ("male", "female") END) AND (CASE WHEN :minage > 0 THEN age >= :minage ELSE age > 0 END) AND (CASE WHEN :maxage > 0 THEN age <= :maxage ELSE age > 0 END) END

UpdateMount

Path

/hdfs/workspaces/a.slam/.tmp/out77a0fabd-0848-4acc-9afe-bbffb4b4bf0e/

MountType

Module

SQL²

IMPORT `./../outfae59abe-799a-44e4-ae8d-86503c55b948/`; CREATE FUNCTION ROUND2(:val, :n) BEGIN ROUND(:val * 10.0 ^ :n) / 10.0 ^ :n END; CREATE FUNCTION CEIL2(:val, :n) BEGIN CEIL(:val * 10.0 ^ :n) / 10.0 ^ :n END; CREATE FUNCTION FLOOR2(:val, :n) BEGIN FLOOR(:val * 10.0 ^ :n) / 10.0 ^ :n END; CREATE FUNCTION card77a0fabd08484acc9afebbffb4b4bf0e(:minage, :gender, :maxage, :state) BEGIN tmp__0 := cardfae59abe799a44e4ae8d86503c55b948(:minage, :gender, :maxage, :state); SELECT AVG(weight) AS measure, city AS category, gender AS stack, null AS parallel FROM (tmp__0) AS tmp__1 GROUP BY gender, city ORDER BY gender ASC, city ASC END

UpdateMount

Path

/hdfs/workspaces/a.slam/.tmp/outb0a4c677-be0c-4ca7-8c3b-1b62704fdb65/

MountType

Module

SQL²

IMPORT `./../out77a0fabd-0848-4acc-9afe-bbffb4b4bf0e/`; CREATE FUNCTION cardb0a4c677be0c4ca78c3b1b62704fdb65(:gender, :chart, :filter, :minage, :maxage, :state) BEGIN tmp__0 := card77a0fabd08484acc9afebbffb4b4bf0e(:minage, :gender, :maxage, :state); CASE WHEN :chart = "bar" THEN SELECT * FROM (tmp__0) AS res WHERE :filter END END

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment