@@ -544,25 +544,73 @@ func (i *interpreter) unaryOverloads(m model.IUnaryExpression) ([]convert.Overlo
544544 }, nil
545545 case * model.Max :
546546 return []convert.Overload [evalUnarySignature ]{
547+ {
548+ Operands : []types.IType {& types.List {ElementType : types .Integer }},
549+ Result : i .evalMaxInteger ,
550+ },
551+ {
552+ Operands : []types.IType {& types.List {ElementType : types .Long }},
553+ Result : i .evalMaxLong ,
554+ },
555+ {
556+ Operands : []types.IType {& types.List {ElementType : types .Decimal }},
557+ Result : i .evalMaxDecimal ,
558+ },
559+ {
560+ Operands : []types.IType {& types.List {ElementType : types .Quantity }},
561+ Result : i .evalMaxQuantity ,
562+ },
547563 {
548564 Operands : []types.IType {& types.List {ElementType : types .Date }},
549- Result : i .evalMaxDateTime ,
565+ Result : i .evalMaxDate ,
550566 },
551567 {
552568 Operands : []types.IType {& types.List {ElementType : types .DateTime }},
553569 Result : i .evalMaxDateTime ,
554570 },
571+ {
572+ Operands : []types.IType {& types.List {ElementType : types .Time }},
573+ Result : i .evalMaxTime ,
574+ },
575+ {
576+ Operands : []types.IType {& types.List {ElementType : types .String }},
577+ Result : i .evalMaxString ,
578+ },
555579 }, nil
556580 case * model.Min :
557581 return []convert.Overload [evalUnarySignature ]{
582+ {
583+ Operands : []types.IType {& types.List {ElementType : types .Integer }},
584+ Result : i .evalMinInteger ,
585+ },
586+ {
587+ Operands : []types.IType {& types.List {ElementType : types .Long }},
588+ Result : i .evalMinLong ,
589+ },
590+ {
591+ Operands : []types.IType {& types.List {ElementType : types .Decimal }},
592+ Result : i .evalMinDecimal ,
593+ },
594+ {
595+ Operands : []types.IType {& types.List {ElementType : types .Quantity }},
596+ Result : i .evalMinQuantity ,
597+ },
558598 {
559599 Operands : []types.IType {& types.List {ElementType : types .Date }},
560- Result : i .evalMinDateTime ,
600+ Result : i .evalMinDate ,
561601 },
562602 {
563603 Operands : []types.IType {& types.List {ElementType : types .DateTime }},
564604 Result : i .evalMinDateTime ,
565605 },
606+ {
607+ Operands : []types.IType {& types.List {ElementType : types .Time }},
608+ Result : i .evalMinTime ,
609+ },
610+ {
611+ Operands : []types.IType {& types.List {ElementType : types .String }},
612+ Result : i .evalMinString ,
613+ },
566614 }, nil
567615 case * model.Sum :
568616 return []convert.Overload [evalUnarySignature ]{
@@ -605,6 +653,115 @@ func (i *interpreter) unaryOverloads(m model.IUnaryExpression) ([]convert.Overlo
605653 Result : i .evalPopulationStdDevQuantity ,
606654 },
607655 }, nil
656+ case * model.PopulationVariance :
657+ return []convert.Overload [evalUnarySignature ]{
658+ {
659+ Operands : []types.IType {& types.List {ElementType : types .Decimal }},
660+ Result : i .evalPopulationVarianceDecimal ,
661+ },
662+ {
663+ Operands : []types.IType {& types.List {ElementType : types .Quantity }},
664+ Result : i .evalPopulationVarianceQuantity ,
665+ },
666+ }, nil
667+ case * model.StdDev :
668+ return []convert.Overload [evalUnarySignature ]{
669+ {
670+ Operands : []types.IType {& types.List {ElementType : types .Decimal }},
671+ Result : i .evalStdDevDecimal ,
672+ },
673+ {
674+ Operands : []types.IType {& types.List {ElementType : types .Quantity }},
675+ Result : i .evalStdDevQuantity ,
676+ },
677+ }, nil
678+ case * model.Variance :
679+ return []convert.Overload [evalUnarySignature ]{
680+ {
681+ Operands : []types.IType {& types.List {ElementType : types .Decimal }},
682+ Result : i .evalVarianceDecimal ,
683+ },
684+ {
685+ Operands : []types.IType {& types.List {ElementType : types .Quantity }},
686+ Result : i .evalVarianceQuantity ,
687+ },
688+ }, nil
689+ case * model.Mode :
690+ return []convert.Overload [evalUnarySignature ]{
691+ {
692+ Operands : []types.IType {& types.List {ElementType : types .Decimal }},
693+ Result : i .evalModeDecimal ,
694+ },
695+ {
696+ Operands : []types.IType {& types.List {ElementType : types .Quantity }},
697+ Result : i .evalModeQuantity ,
698+ },
699+ {
700+ Operands : []types.IType {& types.List {ElementType : types .String }},
701+ Result : i .evalModeString ,
702+ },
703+ {
704+ Operands : []types.IType {& types.List {ElementType : types .Integer }},
705+ Result : i .evalModeInteger ,
706+ },
707+ {
708+ Operands : []types.IType {& types.List {ElementType : types .Long }},
709+ Result : i .evalModeLong ,
710+ },
711+ {
712+ Operands : []types.IType {& types.List {ElementType : types .Date }},
713+ Result : i .evalModeDate ,
714+ },
715+ {
716+ Operands : []types.IType {& types.List {ElementType : types .DateTime }},
717+ Result : i .evalModeDateTime ,
718+ },
719+ {
720+ Operands : []types.IType {& types.List {ElementType : types .Time }},
721+ Result : i .evalModeTime ,
722+ },
723+ }, nil
724+ case * model.GeometricMean :
725+ return []convert.Overload [evalUnarySignature ]{
726+ {
727+ Operands : []types.IType {& types.List {ElementType : types .Decimal }},
728+ Result : i .evalGeometricMeanDecimal ,
729+ },
730+ {
731+ Operands : []types.IType {& types.List {ElementType : types .Quantity }},
732+ Result : i .evalGeometricMeanQuantity ,
733+ },
734+ }, nil
735+ case * model.Product :
736+ return []convert.Overload [evalUnarySignature ]{
737+ {
738+ Operands : []types.IType {& types.List {ElementType : types .Integer }},
739+ Result : i .evalProduct ,
740+ },
741+ {
742+ Operands : []types.IType {& types.List {ElementType : types .Long }},
743+ Result : i .evalProduct ,
744+ },
745+ {
746+ Operands : []types.IType {& types.List {ElementType : types .Decimal }},
747+ Result : i .evalProduct ,
748+ },
749+ {
750+ Operands : []types.IType {& types.List {ElementType : types .Quantity }},
751+ Result : i .evalProduct ,
752+ },
753+ }, nil
754+ case * model.CalculateAge :
755+ return []convert.Overload [evalUnarySignature ]{
756+ {
757+ Operands : []types.IType {types .Date },
758+ Result : evalCalculateAge ,
759+ },
760+ {
761+ Operands : []types.IType {types .DateTime },
762+ Result : evalCalculateAge ,
763+ },
764+ }, nil
608765 case * model.Flatten :
609766 return []convert.Overload [evalUnarySignature ]{
610767 {
@@ -875,6 +1032,14 @@ func (i *interpreter) binaryOverloads(m model.IBinaryExpression) ([]convert.Over
8751032 Operands : []types.IType {types .DateTime , types .DateTime },
8761033 Result : evalDifferenceBetweenDateTime ,
8771034 },
1035+ {
1036+ Operands : []types.IType {types .DateTime , types .Date },
1037+ Result : evalDifferenceBetweenDateTime ,
1038+ },
1039+ {
1040+ Operands : []types.IType {types .Date , types .DateTime },
1041+ Result : evalDifferenceBetweenDateTime ,
1042+ },
8781043 }, nil
8791044 case * model.In :
8801045 // TODO(b/301606416): Support all other In operator overloads.
0 commit comments