2 using System.Collections.Generic;
13 [Trait(
"Category",
"Integration")]
21 var typeDef =
@"{""type"":""record"",""name"":""simple"",""fields"":[{""name"":""id"",""type"":""int""},{""name"":""name"",""type"":""string""}]}";
23 var resp = ctx.Kinetica.createType(typeDef,
"simple_type",
new Dictionary<
string, IList<string>>(),
new Dictionary<string, string>());
25 Assert.False(
string.IsNullOrEmpty(resp.type_id));
26 Assert.Equal(
"simple_type", resp.label);
34 var typeDef =
@"{""type"":""record"",""name"":""pk_type"",""fields"":[{""name"":""id"",""type"":""int""},{""name"":""value"",""type"":""double""}]}";
36 var properties =
new Dictionary<string, IList<string>>
38 {
"id",
new List<string> {
"int",
"primary_key" } }
41 var resp = ctx.Kinetica.createType(typeDef,
"pk_type", properties,
new Dictionary<string, string>());
43 Assert.False(
string.IsNullOrEmpty(resp.type_id));
51 var typeDef =
@"{""type"":""record"",""name"":""multi_props"",""fields"":[{""name"":""id"",""type"":""int""},{""name"":""x"",""type"":""double""},{""name"":""name"",""type"":""string""}]}";
53 var properties =
new Dictionary<string, IList<string>>
55 {
"id",
new List<string> {
"int",
"primary_key" } },
56 {
"x",
new List<string> {
"data" } },
57 {
"name",
new List<string> {
"char32" } }
60 var resp = ctx.Kinetica.createType(typeDef,
"multi_prop_type", properties,
new Dictionary<string, string>());
62 Assert.False(
string.IsNullOrEmpty(resp.type_id));
70 var typeDef =
@"{""type"":""record"",""name"":""complex_type"",""fields"":[{""name"":""id"",""type"":""int""},{""name"":""timestamp"",""type"":""long""},{""name"":""value"",""type"":""double""},{""name"":""name"",""type"":""string""},{""name"":""active"",""type"":""int""},{""name"":""score"",""type"":""float""}]}";
72 var properties =
new Dictionary<string, IList<string>>
74 {
"id",
new List<string> {
"int",
"primary_key" } }
77 var resp = ctx.Kinetica.createType(typeDef,
"complex_type", properties,
new Dictionary<string, string>());
79 Assert.False(
string.IsNullOrEmpty(resp.type_id));
88 var typeDef =
@"{""type"":""record"",""name"":""test"",""fields"":[{""name"":""id"",""type"":""int""}]}";
89 var createResp = ctx.Kinetica.createType(typeDef,
"test_type",
new Dictionary<
string, IList<string>>(),
new Dictionary<string, string>());
92 var hasResp = ctx.Kinetica.hasType(createResp.type_id,
new Dictionary<string, string>());
94 Assert.True(hasResp.type_exists);
102 var hasResp = ctx.Kinetica.hasType(
"nonexistent_type_12345",
new Dictionary<string, string>());
104 Assert.False(hasResp.type_exists);
113 var typeDef =
@"{""type"":""record"",""name"":""string_type"",""fields"":[{""name"":""id"",""type"":""int""},{""name"":""name"",""type"":""string""}]}";
115 var resp = ctx.Kinetica.createType(typeDef,
"string_type",
new Dictionary<
string, IList<string>>(),
new Dictionary<string, string>());
117 Assert.False(
string.IsNullOrEmpty(resp.type_id));
void TestCreateTypeBasic()
void TestHasTypeNotExists()
void TestCreateTypeWithStringField()
Tests for type management endpoints (create_type, has_type).
Test context that manages schema and cleanup for integration tests.
void TestCreateTypeWithMultipleProperties()
void TestCreateTypeComplexSchema()
void TestCreateTypeWithPrimaryKey()