Commit 08d3b65
authored
Simplify type signatures using
* add type sig class
Signed-off-by: jayzhan211 <[email protected]>
* timestamp
Signed-off-by: jayzhan211 <[email protected]>
* date part
Signed-off-by: jayzhan211 <[email protected]>
* fmt
Signed-off-by: jayzhan211 <[email protected]>
* taplo format
Signed-off-by: jayzhan211 <[email protected]>
* tpch test
Signed-off-by: jayzhan211 <[email protected]>
* msrc issue
Signed-off-by: jayzhan211 <[email protected]>
* msrc issue
Signed-off-by: jayzhan211 <[email protected]>
* explicit hash
Signed-off-by: jayzhan211 <[email protected]>
* Enhance type coercion and function signatures
- Added logic to prevent unnecessary casting of string types in `native.rs`.
- Introduced `Comparable` variant in `TypeSignature` to define coercion rules for comparisons.
- Updated imports in `functions.rs` and `signature.rs` for better organization.
- Modified `date_part.rs` to improve handling of timestamp extraction and fixed query tests in `expr.slt`.
- Added `datafusion-macros` dependency in `Cargo.toml` and `Cargo.lock`.
These changes improve type handling and ensure more accurate function behavior in SQL expressions.
* fix comment
Signed-off-by: Jay Zhan <[email protected]>
* fix signature
Signed-off-by: Jay Zhan <[email protected]>
* fix test
Signed-off-by: Jay Zhan <[email protected]>
* Enhance type coercion for timestamps to allow implicit casting from strings. Update SQL logic tests to reflect changes in timestamp handling, including expected outputs for queries involving nanoseconds and seconds.
* Refactor type coercion logic for timestamps to improve readability and maintainability. Update the `TypeSignatureClass` documentation to clarify its purpose in function signatures, particularly regarding coercible types. This change enhances the handling of implicit casting from strings to timestamps.
* Fix SQL logic tests to correct query error handling for timestamp functions. Updated expected outputs for `date_part` and `extract` functions to reflect proper behavior with nanoseconds and seconds. This change improves the accuracy of test cases in the `expr.slt` file.
* Enhance timestamp handling in TypeSignature to support timezone specification. Updated the logic to include an additional DataType for timestamps with a timezone wildcard, improving flexibility in timestamp operations.
* Refactor date_part function: remove redundant imports and add missing not_impl_err import for better error handling
---------
Signed-off-by: jayzhan211 <[email protected]>
Signed-off-by: Jay Zhan <[email protected]>TypeSignatureClass for mixed type function signature (#13372)1 parent 68ead28 commit 08d3b65
File tree
8 files changed
+187
-108
lines changed- datafusion-cli
- datafusion
- common/src/types
- expr-common/src
- expr/src/type_coercion
- functions
- src
- datetime
- string
- sqllogictest/test_files
8 files changed
+187
-108
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
245 | 245 | | |
246 | 246 | | |
247 | 247 | | |
| 248 | + | |
| 249 | + | |
248 | 250 | | |
249 | 251 | | |
250 | 252 | | |
| |||
433 | 435 | | |
434 | 436 | | |
435 | 437 | | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
436 | 463 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
| 22 | + | |
21 | 23 | | |
22 | | - | |
| 24 | + | |
23 | 25 | | |
24 | 26 | | |
25 | 27 | | |
| |||
112 | 114 | | |
113 | 115 | | |
114 | 116 | | |
115 | | - | |
| 117 | + | |
116 | 118 | | |
117 | 119 | | |
118 | 120 | | |
| |||
154 | 156 | | |
155 | 157 | | |
156 | 158 | | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
157 | 186 | | |
158 | 187 | | |
159 | 188 | | |
| |||
180 | 209 | | |
181 | 210 | | |
182 | 211 | | |
183 | | - | |
| 212 | + | |
184 | 213 | | |
185 | 214 | | |
186 | 215 | | |
| |||
255 | 284 | | |
256 | 285 | | |
257 | 286 | | |
258 | | - | |
| 287 | + | |
259 | 288 | | |
260 | 289 | | |
261 | 290 | | |
| |||
290 | 319 | | |
291 | 320 | | |
292 | 321 | | |
293 | | - | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
294 | 346 | | |
295 | 347 | | |
296 | 348 | | |
| |||
424 | 476 | | |
425 | 477 | | |
426 | 478 | | |
427 | | - | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
428 | 483 | | |
429 | 484 | | |
430 | 485 | | |
| |||
618 | 673 | | |
619 | 674 | | |
620 | 675 | | |
621 | | - | |
622 | | - | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
623 | 680 | | |
624 | 681 | | |
625 | 682 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
32 | | - | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
33 | 37 | | |
34 | 38 | | |
35 | 39 | | |
| |||
568 | 572 | | |
569 | 573 | | |
570 | 574 | | |
571 | | - | |
572 | | - | |
573 | | - | |
574 | | - | |
575 | | - | |
576 | | - | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
577 | 579 | | |
578 | | - | |
579 | | - | |
580 | | - | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
581 | 586 | | |
582 | | - | |
583 | | - | |
584 | | - | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
585 | 594 | | |
586 | | - | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
587 | 626 | | |
588 | 627 | | |
589 | 628 | | |
590 | | - | |
| 629 | + | |
591 | 630 | | |
592 | 631 | | |
593 | | - | |
594 | | - | |
595 | | - | |
596 | | - | |
597 | | - | |
598 | | - | |
599 | | - | |
| 632 | + | |
| 633 | + | |
600 | 634 | | |
601 | 635 | | |
602 | 636 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
| 78 | + | |
78 | 79 | | |
79 | 80 | | |
80 | 81 | | |
| |||
0 commit comments