1+ # -*- coding: utf-8 -*-
2+ # MinIO Python Library for Amazon S3 Compatible Cloud Storage, (C) 2019 MinIO, 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+
18+ This module cretaes the request for Select
19+
20+ :copyright: (c) 2019 by MinIO, Inc.
21+ :license: Apache 2.0, see LICENSE for more details.
22+
23+ """
24+ from .helpers import (SQL )
25+
26+ class CSVInput :
27+ """CSVInput.
28+
29+ """
30+ def __init__ (self , FileHeaderInfo = None , RecordDelimiter = "\n " ,
31+ FieldDelimiter = "," , QuoteCharacter = '"' ,
32+ QuoteEscapeCharacter = '"' , Comments = "#" ,
33+ AllowQuotedRecordDelimiter = False ):
34+ self .FileHeaderInfo = FileHeaderInfo
35+ self .RecordDelimiter = RecordDelimiter
36+ self .FieldDelimiter = FieldDelimiter
37+ self .QuoteCharacter = QuoteCharacter
38+ self .QuoteEscapeCharacter = QuoteEscapeCharacter
39+ self .Comments = Comments
40+ self .AllowQuotedRecordDelimiter = AllowQuotedRecordDelimiter
41+
42+ class JSONInput :
43+ """JSONInput.
44+
45+ """
46+ def __init__ (self , Type = None ):
47+ self .Type = Type
48+
49+ class ParquetInput :
50+ """ParquetInput.
51+
52+ """
53+ class InputSerialization :
54+ """InputSerialization.
55+
56+ """
57+ def __init__ (self , compression_type = "NONE" , csv = None , json = None , par = None ):
58+ self .compression_type = compression_type
59+ self .csv_input = csv
60+ self .json_input = json
61+ self .parquet_input = par
62+
63+
64+
65+ class CSVOutput :
66+ """CSVOutput.
67+
68+ """
69+ def __init__ (self , QuoteFields = "ASNEEDED" , RecordDelimiter = "\n " ,
70+ FieldDelimiter = "," , QuoteCharacter = '"' ,
71+ QuoteEscapeCharacter = '"' ):
72+ self .QuoteFields = QuoteFields
73+ self .RecordDelimiter = RecordDelimiter
74+ self .FieldDelimiter = FieldDelimiter
75+ self .QuoteCharacter = QuoteCharacter
76+ self .QuoteEscapeCharacter = QuoteEscapeCharacter
77+
78+ class JsonOutput :
79+ """
80+ JsonOutput.
81+
82+ """
83+ def __init__ (self , RecordDelimiter = "\n " ):
84+ self .RecordDelimiter = RecordDelimiter
85+
86+
87+
88+ class OutputSerialization :
89+ """OutputSerialization.
90+
91+ """
92+ def __init__ (self , csv = None , json = None ):
93+ self .csv_output = csv
94+ self .json_output = json
95+
96+ class RequestProgress :
97+ """RequestProgress.
98+
99+ """
100+ def __init__ (self , enabled = False ):
101+ self .enabled = enabled
102+
103+ class SelectObjectOptions :
104+ """SelectObjectOptions.
105+
106+ """
107+ expression_type = SQL
108+ def __init__ (self , expression , input_serialization , output_serialization , request_progress ):
109+ self .expression = expression
110+ self .in_ser = input_serialization
111+ self .out_ser = output_serialization
112+ self .req_progress = request_progress
0 commit comments