OmniSciDB  04ee39c94c
sql_window_function_to_string.h
Go to the documentation of this file.
1 /*
2  * Copyright 2018 OmniSci, Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #pragma once
18 
19 #include "sqldefs.h"
20 
21 #include <string>
22 #include "Logger.h"
23 
24 inline std::string sql_window_function_to_str(const SqlWindowFunctionKind kind) {
25  switch (kind) {
27  return "ROW_NUMBER";
28  }
30  return "RANK";
31  }
33  return "DENSE_RANK";
34  }
36  return "PERCENT_RANK";
37  }
39  return "CUME_DIST";
40  }
42  return "NTILE";
43  }
45  return "LAG";
46  }
48  return "LEAD";
49  }
51  return "FIRST_VALUE";
52  }
54  return "LAST_VALUE";
55  }
57  return "AVG";
58  }
60  return "MIN";
61  }
63  return "MAX";
64  }
66  return "SUM";
67  }
69  return "COUNT";
70  }
72  return "SUM_INTERNAL";
73  }
74  default: {
75  LOG(FATAL) << "Invalid window function kind";
76  return "";
77  }
78  }
79 }
#define LOG(tag)
Definition: Logger.h:182
std::string sql_window_function_to_str(const SqlWindowFunctionKind kind)
SqlWindowFunctionKind
Definition: sqldefs.h:73
Common Enum definitions for SQL processing.