@@ -304,15 +304,15 @@ func FunctionMap() map[string]physical.FunctionDetails {
304304 OutputType : octosql .String ,
305305 Strict : true ,
306306 Function : func (values []octosql.Value ) (octosql.Value , error ) {
307- return octosql .NewString (strings .Repeat (values [0 ].Str , values [1 ].Int )), nil
307+ return octosql .NewString (strings .Repeat (values [0 ].Str , int ( values [1 ].Int ) )), nil
308308 },
309309 },
310310 {
311311 ArgumentTypes : []octosql.Type {octosql .Int , octosql .String },
312312 OutputType : octosql .String ,
313313 Strict : true ,
314314 Function : func (values []octosql.Value ) (octosql.Value , error ) {
315- return octosql .NewString (strings .Repeat (values [1 ].Str , values [0 ].Int )), nil
315+ return octosql .NewString (strings .Repeat (values [1 ].Str , int ( values [0 ].Int ) )), nil
316316 },
317317 },
318318 },
@@ -718,7 +718,7 @@ func FunctionMap() map[string]physical.FunctionDetails {
718718 OutputType : octosql .String ,
719719 Strict : true ,
720720 Function : func (values []octosql.Value ) (octosql.Value , error ) {
721- if len (values [0 ].Str ) <= values [1 ].Int {
721+ if int64 ( len (values [0 ].Str ) ) <= values [1 ].Int {
722722 return octosql .NewString ("" ), nil
723723 }
724724 return octosql .NewString (values [0 ].Str [values [1 ].Int :]), nil
@@ -729,12 +729,12 @@ func FunctionMap() map[string]physical.FunctionDetails {
729729 OutputType : octosql .String ,
730730 Strict : true ,
731731 Function : func (values []octosql.Value ) (octosql.Value , error ) {
732- if len (values [0 ].Str ) <= values [1 ].Int {
732+ if int64 ( len (values [0 ].Str ) ) <= values [1 ].Int {
733733 return octosql .NewString ("" ), nil
734734 }
735735 end := values [1 ].Int + values [2 ].Int
736- if end > len (values [0 ].Str ) {
737- end = len (values [0 ].Str )
736+ if end > int64 ( len (values [0 ].Str ) ) {
737+ end = int64 ( len (values [0 ].Str ) )
738738 }
739739 return octosql .NewString (values [0 ].Str [values [1 ].Int :end ]), nil
740740 },
@@ -766,7 +766,7 @@ func FunctionMap() map[string]physical.FunctionDetails {
766766 if i == - 1 {
767767 return octosql .NewNull (), nil
768768 }
769- return octosql .NewInt (i ), nil
769+ return octosql .NewInt (int64 ( i ) ), nil
770770 },
771771 },
772772 },
@@ -779,7 +779,7 @@ func FunctionMap() map[string]physical.FunctionDetails {
779779 OutputType : octosql .Int ,
780780 Strict : true ,
781781 Function : func (values []octosql.Value ) (octosql.Value , error ) {
782- return octosql .NewInt (len (values [0 ].Str )), nil
782+ return octosql .NewInt (int64 ( len (values [0 ].Str ) )), nil
783783 },
784784 },
785785 {
@@ -794,7 +794,7 @@ func FunctionMap() map[string]physical.FunctionDetails {
794794 },
795795 Strict : true ,
796796 Function : func (values []octosql.Value ) (octosql.Value , error ) {
797- return octosql .NewInt (len (values [0 ].List )), nil
797+ return octosql .NewInt (int64 ( len (values [0 ].List ) )), nil
798798 },
799799 },
800800 {
@@ -809,7 +809,7 @@ func FunctionMap() map[string]physical.FunctionDetails {
809809 },
810810 Strict : true ,
811811 Function : func (values []octosql.Value ) (octosql.Value , error ) {
812- return octosql .NewInt (len (values [0 ].Struct )), nil
812+ return octosql .NewInt (int64 ( len (values [0 ].Struct ) )), nil
813813 },
814814 },
815815 {
@@ -824,7 +824,7 @@ func FunctionMap() map[string]physical.FunctionDetails {
824824 },
825825 Strict : true ,
826826 Function : func (values []octosql.Value ) (octosql.Value , error ) {
827- return octosql .NewInt (len (values [0 ].Tuple )), nil
827+ return octosql .NewInt (int64 ( len (values [0 ].Tuple ) )), nil
828828 },
829829 },
830830 },
@@ -891,7 +891,7 @@ func FunctionMap() map[string]physical.FunctionDetails {
891891 OutputType : octosql .Int ,
892892 Strict : true ,
893893 Function : func (values []octosql.Value ) (octosql.Value , error ) {
894- return octosql .NewInt (int ( values [0 ].Time .Unix () )), nil
894+ return octosql .NewInt (values [0 ].Time .Unix ()), nil
895895 },
896896 },
897897 },
@@ -927,15 +927,15 @@ func FunctionMap() map[string]physical.FunctionDetails {
927927 OutputType : octosql .Int ,
928928 Strict : true ,
929929 Function : func (values []octosql.Value ) (octosql.Value , error ) {
930- return octosql .NewInt (int (values [0 ].Float )), nil
930+ return octosql .NewInt (int64 (values [0 ].Float )), nil
931931 },
932932 },
933933 {
934934 ArgumentTypes : []octosql.Type {octosql .String },
935935 OutputType : octosql .Int ,
936936 Strict : true ,
937937 Function : func (values []octosql.Value ) (octosql.Value , error ) {
938- n , err := strconv .Atoi (values [0 ].Str )
938+ n , err := strconv .ParseInt (values [0 ].Str , 10 , 64 )
939939 if err != nil {
940940 log .Printf ("couldn't parse string '%s' as int: %s" , values [0 ].Str , err )
941941 return octosql .NewNull (), nil
@@ -948,7 +948,7 @@ func FunctionMap() map[string]physical.FunctionDetails {
948948 OutputType : octosql .Int ,
949949 Strict : true ,
950950 Function : func (values []octosql.Value ) (octosql.Value , error ) {
951- return octosql .NewInt (int (values [0 ].Duration )), nil
951+ return octosql .NewInt (int64 (values [0 ].Duration )), nil
952952 },
953953 },
954954 },
@@ -1033,7 +1033,7 @@ func FunctionMap() map[string]physical.FunctionDetails {
10331033 },
10341034 Strict : true ,
10351035 Function : func (values []octosql.Value ) (octosql.Value , error ) {
1036- if values [1 ].Int >= len (values [0 ].List ) {
1036+ if values [1 ].Int >= int64 ( len (values [0 ].List ) ) {
10371037 return octosql .NewNull (), nil
10381038 }
10391039 return values [0 ].List [values [1 ].Int ], nil
0 commit comments