OmniSciDB
a5dc49c757
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
DBETypes.h
Go to the documentation of this file.
1
/*
2
* Copyright 2022 HEAVY.AI, 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 "
QueryEngine/TargetValue.h
"
20
#include "
Shared/sqltypes.h
"
21
22
namespace
EmbeddedDatabase {
23
24
enum class
ColumnType
{
25
SMALLINT
= 0,
26
INT
= 1,
27
BIGINT
= 2,
28
FLOAT
= 3,
29
DECIMAL
= 4,
30
DOUBLE
= 5,
31
STR
= 6,
32
TIME
= 7,
33
TIMESTAMP
= 8,
34
DATE
= 9,
35
BOOL
= 10,
36
INTERVAL_DAY_TIME
= 11,
37
INTERVAL_YEAR_MONTH
= 12,
38
POINT
= 13,
39
LINESTRING
= 14,
40
POLYGON
= 15,
41
MULTIPOLYGON
= 16,
42
TINYINT
= 17,
43
GEOMETRY
= 18,
44
GEOGRAPHY
= 19,
45
UNKNOWN
= 20
46
};
47
48
enum class
ColumnEncoding
{
49
NONE
= 0,
50
FIXED
= 1,
51
RL
= 2,
52
DIFF
= 3,
53
DICT
= 4,
54
SPARSE
= 5,
55
GEOINT
= 6,
56
DATE_IN_DAYS
= 7
57
};
58
59
class
ColumnDetails
{
60
public
:
61
std::string
col_name
;
62
ColumnType
col_type
;
63
ColumnEncoding
encoding
;
64
bool
nullable
;
65
bool
is_array
;
66
int
precision
;
67
int
scale
;
68
int
comp_param
;
69
70
ColumnDetails
();
71
72
ColumnDetails
(
const
std::string&
col_name
,
73
ColumnType
col_type
,
74
ColumnEncoding
encoding
,
75
bool
nullable
,
76
bool
is_array
,
77
int
precision
,
78
int
scale
,
79
int
comp_param
);
80
};
81
82
class
Row
{
83
public
:
84
Row
();
85
Row
(std::vector<TargetValue>& row);
86
int64_t
getInt
(
size_t
col_num);
87
float
getFloat
(
size_t
col_num);
88
double
getDouble
(
size_t
col_num);
89
std::string
getStr
(
size_t
col_num);
90
91
private
:
92
std::vector<TargetValue>
row_
;
93
};
94
95
ColumnType
sqlToColumnType
(
const
SQLTypes
&
type
);
96
ColumnEncoding
sqlToColumnEncoding
(
const
EncodingType
&
type
);
97
}
// namespace EmbeddedDatabase
EmbeddedDatabase::Row::getStr
std::string getStr(size_t col_num)
Definition:
DBETypes.cpp:98
EmbeddedDatabase::ColumnEncoding::NONE
EmbeddedDatabase::ColumnType::GEOGRAPHY
EmbeddedDatabase::ColumnDetails::col_name
std::string col_name
Definition:
DBETypes.h:61
EmbeddedDatabase::ColumnDetails::comp_param
int comp_param
Definition:
DBETypes.h:68
EmbeddedDatabase::ColumnType::FLOAT
EmbeddedDatabase::Row::getDouble
double getDouble(size_t col_num)
Definition:
DBETypes.cpp:91
EmbeddedDatabase::ColumnType::INTERVAL_YEAR_MONTH
SQLTypes
SQLTypes
Definition:
sqltypes.h:65
EmbeddedDatabase::ColumnType::BOOL
EmbeddedDatabase::ColumnDetails::is_array
bool is_array
Definition:
DBETypes.h:65
EmbeddedDatabase::ColumnType::DOUBLE
TargetValue.h
High-level representation of SQL values.
sqltypes.h
Constants for Builtin SQL Types supported by HEAVY.AI.
EmbeddedDatabase::ColumnType::SMALLINT
EmbeddedDatabase::ColumnDetails::ColumnDetails
ColumnDetails()
Definition:
DBETypes.cpp:45
EmbeddedDatabase::Row::Row
Row()
Definition:
DBETypes.cpp:73
EmbeddedDatabase::ColumnEncoding::DICT
EmbeddedDatabase::Row::getFloat
float getFloat(size_t col_num)
Definition:
DBETypes.cpp:84
EmbeddedDatabase::ColumnType::DATE
EmbeddedDatabase::Row::getInt
int64_t getInt(size_t col_num)
Definition:
DBETypes.cpp:77
EmbeddedDatabase::ColumnEncoding::DATE_IN_DAYS
EmbeddedDatabase::sqlToColumnType
ColumnType sqlToColumnType(const SQLTypes &type)
Definition:
DBETypes.cpp:111
EncodingType
EncodingType
Definition:
sqltypes.h:240
EmbeddedDatabase::ColumnType::GEOMETRY
EmbeddedDatabase::ColumnType::BIGINT
EmbeddedDatabase::ColumnEncoding::GEOINT
EmbeddedDatabase::Row
Definition:
DBETypes.h:82
EmbeddedDatabase::ColumnType::TINYINT
EmbeddedDatabase::ColumnDetails::encoding
ColumnEncoding encoding
Definition:
DBETypes.h:63
EmbeddedDatabase::ColumnType::TIMESTAMP
EmbeddedDatabase::ColumnDetails::nullable
bool nullable
Definition:
DBETypes.h:64
EmbeddedDatabase::ColumnEncoding::FIXED
EmbeddedDatabase::ColumnType::INT
EmbeddedDatabase::Row::row_
std::vector< TargetValue > row_
Definition:
DBETypes.h:92
EmbeddedDatabase::ColumnEncoding::SPARSE
EmbeddedDatabase::ColumnType::MULTIPOLYGON
EmbeddedDatabase::sqlToColumnEncoding
ColumnEncoding sqlToColumnEncoding(const EncodingType &type)
Definition:
DBETypes.cpp:162
EmbeddedDatabase::ColumnEncoding::DIFF
EmbeddedDatabase::ColumnDetails::col_type
ColumnType col_type
Definition:
DBETypes.h:62
EmbeddedDatabase::ColumnDetails::scale
int scale
Definition:
DBETypes.h:67
EmbeddedDatabase::ColumnDetails::precision
int precision
Definition:
DBETypes.h:66
EmbeddedDatabase::ColumnType::TIME
EmbeddedDatabase::ColumnEncoding
ColumnEncoding
Definition:
DBETypes.h:48
EmbeddedDatabase::ColumnType::POINT
EmbeddedDatabase::ColumnType::UNKNOWN
EmbeddedDatabase::ColumnType::LINESTRING
EmbeddedDatabase::ColumnType::DECIMAL
EmbeddedDatabase::ColumnType::POLYGON
EmbeddedDatabase::ColumnDetails
Definition:
DBETypes.h:59
EmbeddedDatabase::ColumnType::STR
EmbeddedDatabase::ColumnType::INTERVAL_DAY_TIME
EmbeddedDatabase::ColumnType
ColumnType
Definition:
DBETypes.h:24
EmbeddedDatabase::ColumnEncoding::RL
run_benchmark_import.type
type
Definition:
run_benchmark_import.py:89
Embedded
DBETypes.h
Generated on Tue Aug 27 2024 00:12:37 for OmniSciDB by
1.8.5