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
HeavyDBSerializer.java
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
package
com.mapd.calcite.parser;
18
19
import
com.google.gson.Gson;
20
import
com.google.gson.GsonBuilder;
21
import
com.mapd.parser.extension.ddl.DdlResponse
;
22
import
com.mapd.parser.extension.ddl.JsonSerializableDdl
;
23
24
import
org.apache.calcite.rel.RelNode;
25
import
org.apache.calcite.rel.externalize.HeavyDBRelJsonWriter
;
26
27
public
class
HeavyDBSerializer
{
28
private
static
final
Gson
gson
;
29
30
static
{
31
gson
=
new
GsonBuilder().excludeFieldsWithoutExposeAnnotation().
create
();
32
}
33
34
public
static
String
toString
(
final
RelNode rel) {
35
if
(rel == null) {
36
return
null;
37
}
38
final
HeavyDBRelJsonWriter
planWriter =
new
HeavyDBRelJsonWriter
();
39
rel.explain(planWriter);
40
return
planWriter.asString();
41
}
42
43
public
static
String
toJsonString
(
final
JsonSerializableDdl
jsonSerializableDdl) {
44
final
DdlResponse
ddlResponse =
new
DdlResponse
();
45
ddlResponse.setPayload(jsonSerializableDdl);
46
return
gson.toJson(ddlResponse);
47
}
48
}
com.mapd.parser.extension.ddl.JsonSerializableDdl
Definition:
JsonSerializableDdl.java:5
File_Namespace::create
std::pair< FILE *, std::string > create(const std::string &basePath, const int fileId, const size_t pageSize, const size_t numPages)
Definition:
File.cpp:55
com.mapd.calcite.parser.HeavyDBSerializer.toJsonString
static String toJsonString(final JsonSerializableDdl jsonSerializableDdl)
Definition:
HeavyDBSerializer.java:43
com.mapd.calcite.parser.HeavyDBSerializer
Definition:
HeavyDBSerializer.java:27
org.apache.calcite.rel.externalize.HeavyDBRelJsonWriter
Definition:
HeavyDBRelJsonWriter.java:39
com.mapd.parser.extension.ddl.DdlResponse
Definition:
DdlResponse.java:5
com.mapd.calcite.parser.HeavyDBSerializer.toString
static String toString(final RelNode rel)
Definition:
HeavyDBSerializer.java:34
com.mapd.calcite.parser.HeavyDBSerializer.gson
static final Gson gson
Definition:
HeavyDBSerializer.java:28
java
calcite
src
main
java
com
mapd
calcite
parser
HeavyDBSerializer.java
Generated on Tue Aug 27 2024 00:12:38 for OmniSciDB by
1.8.5