-
Notifications
You must be signed in to change notification settings - Fork 60
Expand file tree
/
Copy pathprotocol_feature_util.go
More file actions
46 lines (38 loc) · 2.15 KB
/
protocol_feature_util.go
File metadata and controls
46 lines (38 loc) · 2.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package thrift_protocol
import "github.com/databricks/databricks-sql-go/internal/cli_service"
// Feature checks
// SupportsDirectResults checks if the server protocol version supports direct results
// Supported in SPARK_CLI_SERVICE_PROTOCOL_V1 and above
func SupportsDirectResults(version cli_service.TProtocolVersion) bool {
return version >= cli_service.TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V1
}
// SupportsLz4Compression checks if the server protocol version supports LZ4 compression
// Supported in SPARK_CLI_SERVICE_PROTOCOL_V6 and above
func SupportsLz4Compression(version cli_service.TProtocolVersion) bool {
return version >= cli_service.TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V6
}
// SupportsCloudFetch checks if the server protocol version supports cloud fetch
// Supported in SPARK_CLI_SERVICE_PROTOCOL_V3 and above
func SupportsCloudFetch(version cli_service.TProtocolVersion) bool {
return version >= cli_service.TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V3
}
// SupportsArrow checks if the server protocol version supports Arrow format
// Supported in SPARK_CLI_SERVICE_PROTOCOL_V5 and above
func SupportsArrow(version cli_service.TProtocolVersion) bool {
return version >= cli_service.TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V5
}
// SupportsCompressedArrow checks if the server protocol version supports compressed Arrow format
// Supported in SPARK_CLI_SERVICE_PROTOCOL_V6 and above
func SupportsCompressedArrow(version cli_service.TProtocolVersion) bool {
return version >= cli_service.TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V6
}
// SupportsParameterizedQueries checks if the server protocol version supports parameterized queries
// Supported in SPARK_CLI_SERVICE_PROTOCOL_V8 and above
func SupportsParameterizedQueries(version cli_service.TProtocolVersion) bool {
return version >= cli_service.TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V8
}
// SupportsMultipleCatalogs checks if the server protocol version supports multiple catalogs
// Supported in SPARK_CLI_SERVICE_PROTOCOL_V4 and above
func SupportsMultipleCatalogs(version cli_service.TProtocolVersion) bool {
return version >= cli_service.TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V4
}