--- source: prqlc/prqlc/tests/integration/queries.rs expression: "# mssql:test\nfrom [\n { id = 1, x_int = 13, x_float = 13.0, k_int = 5, k_float = 5.0 },\n { id = 2, x_int = -13, x_float = -13.0, k_int = 5, k_float = 5.0 },\n { id = 3, x_int = 13, x_float = 13.0, k_int = -5, k_float = -5.0 },\n { id = 4, x_int = -13, x_float = -13.0, k_int = -5, k_float = -5.0 },\n]\nselect {\n id,\n\n x_int / k_int,\n x_int / k_float,\n x_float / k_int,\n x_float / k_float,\n\n q_ii = x_int // k_int,\n q_if = x_int // k_float,\n q_fi = x_float // k_int,\n q_ff = x_float // k_float,\n\n r_ii = x_int % k_int,\n r_if = x_int % k_float,\n r_fi = x_float % k_int,\n r_ff = x_float % k_float,\n\n (q_ii * k_int + r_ii | math.round 0),\n (q_if * k_float + r_if | math.round 0),\n (q_fi * k_int + r_fi | math.round 0),\n (q_ff * k_float + r_ff | math.round 0),\n}\nsort id\n" input_file: prqlc/prqlc/tests/integration/queries/arithmetic.prql snapshot_kind: text --- frames: - - 1:318-824 - columns: - !Single name: - _literal_121 - id target_id: 163 target_name: null - !Single name: null target_id: 164 target_name: null - !Single name: null target_id: 168 target_name: null - !Single name: null target_id: 172 target_name: null - !Single name: null target_id: 176 target_name: null - !Single name: - q_ii target_id: 180 target_name: null - !Single name: - q_if target_id: 184 target_name: null - !Single name: - q_fi target_id: 188 target_name: null - !Single name: - q_ff target_id: 192 target_name: null - !Single name: - r_ii target_id: 196 target_name: null - !Single name: - r_if target_id: 200 target_name: null - !Single name: - r_fi target_id: 204 target_name: null - !Single name: - r_ff target_id: 208 target_name: null - !Single name: null target_id: 212 target_name: null - !Single name: null target_id: 223 target_name: null - !Single name: null target_id: 234 target_name: null - !Single name: null target_id: 245 target_name: null inputs: - id: 121 name: _literal_121 table: - default_db - _literal_121 - - 1:825-832 - columns: - !Single name: - _literal_121 - id target_id: 163 target_name: null - !Single name: null target_id: 164 target_name: null - !Single name: null target_id: 168 target_name: null - !Single name: null target_id: 172 target_name: null - !Single name: null target_id: 176 target_name: null - !Single name: - q_ii target_id: 180 target_name: null - !Single name: - q_if target_id: 184 target_name: null - !Single name: - q_fi target_id: 188 target_name: null - !Single name: - q_ff target_id: 192 target_name: null - !Single name: - r_ii target_id: 196 target_name: null - !Single name: - r_if target_id: 200 target_name: null - !Single name: - r_fi target_id: 204 target_name: null - !Single name: - r_ff target_id: 208 target_name: null - !Single name: null target_id: 212 target_name: null - !Single name: null target_id: 223 target_name: null - !Single name: null target_id: 234 target_name: null - !Single name: null target_id: 245 target_name: null inputs: - id: 121 name: _literal_121 table: - default_db - _literal_121 nodes: - id: 121 kind: Array span: 1:13-317 children: - 122 - 128 - 138 - 148 parent: 257 - id: 122 kind: Tuple span: 1:24-92 children: - 123 - 124 - 125 - 126 - 127 parent: 121 - id: 123 kind: Literal span: 1:31-32 alias: id parent: 122 - id: 124 kind: Literal span: 1:43-45 alias: x_int parent: 122 - id: 125 kind: Literal span: 1:58-62 alias: x_float parent: 122 - id: 126 kind: Literal span: 1:73-74 alias: k_int parent: 122 - id: 127 kind: Literal span: 1:87-90 alias: k_float parent: 122 - id: 128 kind: Tuple span: 1:98-166 children: - 129 - 130 - 133 - 136 - 137 parent: 121 - id: 129 kind: Literal span: 1:105-106 alias: id parent: 128 - id: 130 kind: Literal span: 1:116-119 alias: x_int parent: 128 - id: 133 kind: Literal span: 1:131-136 alias: x_float parent: 128 - id: 136 kind: Literal span: 1:147-148 alias: k_int parent: 128 - id: 137 kind: Literal span: 1:161-164 alias: k_float parent: 128 - id: 138 kind: Tuple span: 1:172-240 children: - 139 - 140 - 141 - 142 - 145 parent: 121 - id: 139 kind: Literal span: 1:179-180 alias: id parent: 138 - id: 140 kind: Literal span: 1:191-193 alias: x_int parent: 138 - id: 141 kind: Literal span: 1:206-210 alias: x_float parent: 138 - id: 142 kind: Literal span: 1:220-222 alias: k_int parent: 138 - id: 145 kind: Literal span: 1:234-238 alias: k_float parent: 138 - id: 148 kind: Tuple span: 1:246-314 children: - 149 - 150 - 153 - 156 - 159 parent: 121 - id: 149 kind: Literal span: 1:253-254 alias: id parent: 148 - id: 150 kind: Literal span: 1:264-267 alias: x_int parent: 148 - id: 153 kind: Literal span: 1:279-284 alias: x_float parent: 148 - id: 156 kind: Literal span: 1:294-296 alias: k_int parent: 148 - id: 159 kind: Literal span: 1:308-312 alias: k_float parent: 148 - id: 163 kind: Ident span: 1:331-333 ident: !Ident - this - _literal_121 - id targets: - 121 parent: 256 - id: 164 kind: RqOperator span: 1:340-353 targets: - 166 - 167 parent: 256 - id: 166 kind: Ident span: 1:340-345 ident: !Ident - this - _literal_121 - x_int targets: - 121 - id: 167 kind: Ident span: 1:348-353 ident: !Ident - this - _literal_121 - k_int targets: - 121 - id: 168 kind: RqOperator span: 1:359-374 targets: - 170 - 171 parent: 256 - id: 170 kind: Ident span: 1:359-364 ident: !Ident - this - _literal_121 - x_int targets: - 121 - id: 171 kind: Ident span: 1:367-374 ident: !Ident - this - _literal_121 - k_float targets: - 121 - id: 172 kind: RqOperator span: 1:380-395 targets: - 174 - 175 parent: 256 - id: 174 kind: Ident span: 1:380-387 ident: !Ident - this - _literal_121 - x_float targets: - 121 - id: 175 kind: Ident span: 1:390-395 ident: !Ident - this - _literal_121 - k_int targets: - 121 - id: 176 kind: RqOperator span: 1:401-418 targets: - 178 - 179 parent: 256 - id: 178 kind: Ident span: 1:401-408 ident: !Ident - this - _literal_121 - x_float targets: - 121 - id: 179 kind: Ident span: 1:411-418 ident: !Ident - this - _literal_121 - k_float targets: - 121 - id: 180 kind: RqOperator span: 1:432-446 alias: q_ii targets: - 182 - 183 parent: 256 - id: 182 kind: Ident span: 1:432-437 ident: !Ident - this - _literal_121 - x_int targets: - 121 - id: 183 kind: Ident span: 1:441-446 ident: !Ident - this - _literal_121 - k_int targets: - 121 - id: 184 kind: RqOperator span: 1:459-475 alias: q_if targets: - 186 - 187 parent: 256 - id: 186 kind: Ident span: 1:459-464 ident: !Ident - this - _literal_121 - x_int targets: - 121 - id: 187 kind: Ident span: 1:468-475 ident: !Ident - this - _literal_121 - k_float targets: - 121 - id: 188 kind: RqOperator span: 1:488-504 alias: q_fi targets: - 190 - 191 parent: 256 - id: 190 kind: Ident span: 1:488-495 ident: !Ident - this - _literal_121 - x_float targets: - 121 - id: 191 kind: Ident span: 1:499-504 ident: !Ident - this - _literal_121 - k_int targets: - 121 - id: 192 kind: RqOperator span: 1:517-535 alias: q_ff targets: - 194 - 195 parent: 256 - id: 194 kind: Ident span: 1:517-524 ident: !Ident - this - _literal_121 - x_float targets: - 121 - id: 195 kind: Ident span: 1:528-535 ident: !Ident - this - _literal_121 - k_float targets: - 121 - id: 196 kind: RqOperator span: 1:549-562 alias: r_ii targets: - 198 - 199 parent: 256 - id: 198 kind: Ident span: 1:549-554 ident: !Ident - this - _literal_121 - x_int targets: - 121 - id: 199 kind: Ident span: 1:557-562 ident: !Ident - this - _literal_121 - k_int targets: - 121 - id: 200 kind: RqOperator span: 1:575-590 alias: r_if targets: - 202 - 203 parent: 256 - id: 202 kind: Ident span: 1:575-580 ident: !Ident - this - _literal_121 - x_int targets: - 121 - id: 203 kind: Ident span: 1:583-590 ident: !Ident - this - _literal_121 - k_float targets: - 121 - id: 204 kind: RqOperator span: 1:603-618 alias: r_fi targets: - 206 - 207 parent: 256 - id: 206 kind: Ident span: 1:603-610 ident: !Ident - this - _literal_121 - x_float targets: - 121 - id: 207 kind: Ident span: 1:613-618 ident: !Ident - this - _literal_121 - k_int targets: - 121 - id: 208 kind: RqOperator span: 1:631-648 alias: r_ff targets: - 210 - 211 parent: 256 - id: 210 kind: Ident span: 1:631-638 ident: !Ident - this - _literal_121 - x_float targets: - 121 - id: 211 kind: Ident span: 1:641-648 ident: !Ident - this - _literal_121 - k_float targets: - 121 - id: 212 kind: RqOperator span: 1:678-690 targets: - 215 - 216 parent: 256 - id: 215 kind: Literal span: 1:689-690 - id: 216 kind: RqOperator span: 1:656-675 targets: - 218 - 222 - id: 218 kind: RqOperator span: 1:656-668 targets: - 220 - 221 - id: 220 kind: Ident span: 1:656-660 ident: !Ident - this - q_ii targets: - 180 - id: 221 kind: Ident span: 1:663-668 ident: !Ident - this - _literal_121 - k_int targets: - 121 - id: 222 kind: Ident span: 1:671-675 ident: !Ident - this - r_ii targets: - 196 - id: 223 kind: RqOperator span: 1:722-734 targets: - 226 - 227 parent: 256 - id: 226 kind: Literal span: 1:733-734 - id: 227 kind: RqOperator span: 1:698-719 targets: - 229 - 233 - id: 229 kind: RqOperator span: 1:698-712 targets: - 231 - 232 - id: 231 kind: Ident span: 1:698-702 ident: !Ident - this - q_if targets: - 184 - id: 232 kind: Ident span: 1:705-712 ident: !Ident - this - _literal_121 - k_float targets: - 121 - id: 233 kind: Ident span: 1:715-719 ident: !Ident - this - r_if targets: - 200 - id: 234 kind: RqOperator span: 1:764-776 targets: - 237 - 238 parent: 256 - id: 237 kind: Literal span: 1:775-776 - id: 238 kind: RqOperator span: 1:742-761 targets: - 240 - 244 - id: 240 kind: RqOperator span: 1:742-754 targets: - 242 - 243 - id: 242 kind: Ident span: 1:742-746 ident: !Ident - this - q_fi targets: - 188 - id: 243 kind: Ident span: 1:749-754 ident: !Ident - this - _literal_121 - k_int targets: - 121 - id: 244 kind: Ident span: 1:757-761 ident: !Ident - this - r_fi targets: - 204 - id: 245 kind: RqOperator span: 1:808-820 targets: - 248 - 249 parent: 256 - id: 248 kind: Literal span: 1:819-820 - id: 249 kind: RqOperator span: 1:784-805 targets: - 251 - 255 - id: 251 kind: RqOperator span: 1:784-798 targets: - 253 - 254 - id: 253 kind: Ident span: 1:784-788 ident: !Ident - this - q_ff targets: - 192 - id: 254 kind: Ident span: 1:791-798 ident: !Ident - this - _literal_121 - k_float targets: - 121 - id: 255 kind: Ident span: 1:801-805 ident: !Ident - this - r_ff targets: - 208 - id: 256 kind: Tuple span: 1:325-824 children: - 163 - 164 - 168 - 172 - 176 - 180 - 184 - 188 - 192 - 196 - 200 - 204 - 208 - 212 - 223 - 234 - 245 parent: 257 - id: 257 kind: 'TransformCall: Select' span: 1:318-824 children: - 121 - 256 parent: 260 - id: 258 kind: Ident span: 1:830-832 ident: !Ident - this - _literal_121 - id targets: - 163 parent: 260 - id: 260 kind: 'TransformCall: Sort' span: 1:825-832 children: - 257 - 258 ast: name: Project stmts: - VarDef: kind: Main name: main value: Pipeline: exprs: - FuncCall: name: Ident: from span: 1:13-17 args: - Array: - Tuple: - Literal: Integer: 1 span: 1:31-32 alias: id - Literal: Integer: 13 span: 1:43-45 alias: x_int - Literal: Float: 13.0 span: 1:58-62 alias: x_float - Literal: Integer: 5 span: 1:73-74 alias: k_int - Literal: Float: 5.0 span: 1:87-90 alias: k_float span: 1:24-92 - Tuple: - Literal: Integer: 2 span: 1:105-106 alias: id - Unary: op: Neg expr: Literal: Integer: 13 span: 1:117-119 span: 1:116-119 alias: x_int - Unary: op: Neg expr: Literal: Float: 13.0 span: 1:132-136 span: 1:131-136 alias: x_float - Literal: Integer: 5 span: 1:147-148 alias: k_int - Literal: Float: 5.0 span: 1:161-164 alias: k_float span: 1:98-166 - Tuple: - Literal: Integer: 3 span: 1:179-180 alias: id - Literal: Integer: 13 span: 1:191-193 alias: x_int - Literal: Float: 13.0 span: 1:206-210 alias: x_float - Unary: op: Neg expr: Literal: Integer: 5 span: 1:221-222 span: 1:220-222 alias: k_int - Unary: op: Neg expr: Literal: Float: 5.0 span: 1:235-238 span: 1:234-238 alias: k_float span: 1:172-240 - Tuple: - Literal: Integer: 4 span: 1:253-254 alias: id - Unary: op: Neg expr: Literal: Integer: 13 span: 1:265-267 span: 1:264-267 alias: x_int - Unary: op: Neg expr: Literal: Float: 13.0 span: 1:280-284 span: 1:279-284 alias: x_float - Unary: op: Neg expr: Literal: Integer: 5 span: 1:295-296 span: 1:294-296 alias: k_int - Unary: op: Neg expr: Literal: Float: 5.0 span: 1:309-312 span: 1:308-312 alias: k_float span: 1:246-314 span: 1:18-317 span: 1:13-317 - FuncCall: name: Ident: select span: 1:318-324 args: - Tuple: - Ident: id span: 1:331-333 - Binary: left: Ident: x_int span: 1:340-345 op: DivFloat right: Ident: k_int span: 1:348-353 span: 1:340-353 - Binary: left: Ident: x_int span: 1:359-364 op: DivFloat right: Ident: k_float span: 1:367-374 span: 1:359-374 - Binary: left: Ident: x_float span: 1:380-387 op: DivFloat right: Ident: k_int span: 1:390-395 span: 1:380-395 - Binary: left: Ident: x_float span: 1:401-408 op: DivFloat right: Ident: k_float span: 1:411-418 span: 1:401-418 - Binary: left: Ident: x_int span: 1:432-437 op: DivInt right: Ident: k_int span: 1:441-446 span: 1:432-446 alias: q_ii - Binary: left: Ident: x_int span: 1:459-464 op: DivInt right: Ident: k_float span: 1:468-475 span: 1:459-475 alias: q_if - Binary: left: Ident: x_float span: 1:488-495 op: DivInt right: Ident: k_int span: 1:499-504 span: 1:488-504 alias: q_fi - Binary: left: Ident: x_float span: 1:517-524 op: DivInt right: Ident: k_float span: 1:528-535 span: 1:517-535 alias: q_ff - Binary: left: Ident: x_int span: 1:549-554 op: Mod right: Ident: k_int span: 1:557-562 span: 1:549-562 alias: r_ii - Binary: left: Ident: x_int span: 1:575-580 op: Mod right: Ident: k_float span: 1:583-590 span: 1:575-590 alias: r_if - Binary: left: Ident: x_float span: 1:603-610 op: Mod right: Ident: k_int span: 1:613-618 span: 1:603-618 alias: r_fi - Binary: left: Ident: x_float span: 1:631-638 op: Mod right: Ident: k_float span: 1:641-648 span: 1:631-648 alias: r_ff - Pipeline: exprs: - Binary: left: Binary: left: Ident: q_ii span: 1:656-660 op: Mul right: Ident: k_int span: 1:663-668 span: 1:656-668 op: Add right: Ident: r_ii span: 1:671-675 span: 1:656-675 - FuncCall: name: Indirection: base: Ident: math span: 1:678-682 field: !Name round span: 1:682-688 args: - Literal: Integer: 0 span: 1:689-690 span: 1:678-690 span: 1:655-691 - Pipeline: exprs: - Binary: left: Binary: left: Ident: q_if span: 1:698-702 op: Mul right: Ident: k_float span: 1:705-712 span: 1:698-712 op: Add right: Ident: r_if span: 1:715-719 span: 1:698-719 - FuncCall: name: Indirection: base: Ident: math span: 1:722-726 field: !Name round span: 1:726-732 args: - Literal: Integer: 0 span: 1:733-734 span: 1:722-734 span: 1:697-735 - Pipeline: exprs: - Binary: left: Binary: left: Ident: q_fi span: 1:742-746 op: Mul right: Ident: k_int span: 1:749-754 span: 1:742-754 op: Add right: Ident: r_fi span: 1:757-761 span: 1:742-761 - FuncCall: name: Indirection: base: Ident: math span: 1:764-768 field: !Name round span: 1:768-774 args: - Literal: Integer: 0 span: 1:775-776 span: 1:764-776 span: 1:741-777 - Pipeline: exprs: - Binary: left: Binary: left: Ident: q_ff span: 1:784-788 op: Mul right: Ident: k_float span: 1:791-798 span: 1:784-798 op: Add right: Ident: r_ff span: 1:801-805 span: 1:784-805 - FuncCall: name: Indirection: base: Ident: math span: 1:808-812 field: !Name round span: 1:812-818 args: - Literal: Integer: 0 span: 1:819-820 span: 1:808-820 span: 1:783-821 span: 1:325-824 span: 1:318-824 - FuncCall: name: Ident: sort span: 1:825-829 args: - Ident: id span: 1:830-832 span: 1:825-832 span: 1:13-832 span: 1:0-832