This is an automated email from the ASF dual-hosted git repository.
ptupitsyn pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/ignite-3.git
The following commit(s) were added to refs/heads/main by this push:
new 1467a04d92 IGNITE-22856 .NET: Delete unsupported column types NUMBER
and BITMASK (#4172)
1467a04d92 is described below
commit 1467a04d922a24f950ecc612473116bbd281eccc
Author: Pavel Tupitsyn <[email protected]>
AuthorDate: Mon Aug 5 08:46:14 2024 +0300
IGNITE-22856 .NET: Delete unsupported column types NUMBER and BITMASK
(#4172)
---
modules/platforms/dotnet/Apache.Ignite.Tests/ConnectionTests.cs | 1 -
.../Apache.Ignite.Tests/Proto/BinaryTuple/BinaryTupleTests.cs | 2 --
.../dotnet/Apache.Ignite.Tests/Proto/ColocationHashTests.cs | 2 --
.../dotnet/Apache.Ignite.Tests/Sql/ColumnTypeExtensionsTests.cs | 4 +---
modules/platforms/dotnet/Apache.Ignite.Tests/Sql/SqlTests.cs | 2 --
.../dotnet/Apache.Ignite.Tests/Table/DataStreamerTests.cs | 2 --
.../dotnet/Apache.Ignite.Tests/Table/RecordViewBinaryTests.cs | 1 -
.../dotnet/Apache.Ignite.Tests/Table/RecordViewPocoTests.cs | 1 -
modules/platforms/dotnet/Apache.Ignite/Compute/ITaskExecution.cs | 1 -
.../Internal/Proto/BinaryTuple/BinaryTupleBuilder.cs | 1 -
.../Internal/Proto/BinaryTuple/BinaryTupleReader.cs | 2 --
.../dotnet/Apache.Ignite/Internal/Sql/ColumnTypeExtensions.cs | 8 --------
modules/platforms/dotnet/Apache.Ignite/Internal/Sql/Sql.cs | 3 ---
.../Internal/Table/Serialization/BinaryTupleMethods.cs | 2 --
modules/platforms/dotnet/Apache.Ignite/Sql/ColumnType.cs | 9 ++-------
15 files changed, 3 insertions(+), 38 deletions(-)
diff --git a/modules/platforms/dotnet/Apache.Ignite.Tests/ConnectionTests.cs
b/modules/platforms/dotnet/Apache.Ignite.Tests/ConnectionTests.cs
index aafbc9adfd..118e8791d8 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Tests/ConnectionTests.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Tests/ConnectionTests.cs
@@ -20,7 +20,6 @@ namespace Apache.Ignite.Tests;
using System.Collections.Generic;
using System.Linq;
using System.Net;
-using System.Net.Sockets;
using System.Threading.Tasks;
using Internal.Network;
using Network;
diff --git
a/modules/platforms/dotnet/Apache.Ignite.Tests/Proto/BinaryTuple/BinaryTupleTests.cs
b/modules/platforms/dotnet/Apache.Ignite.Tests/Proto/BinaryTuple/BinaryTupleTests.cs
index 461ef57c8f..1ff923d3ca 100644
---
a/modules/platforms/dotnet/Apache.Ignite.Tests/Proto/BinaryTuple/BinaryTupleTests.cs
+++
b/modules/platforms/dotnet/Apache.Ignite.Tests/Proto/BinaryTuple/BinaryTupleTests.cs
@@ -18,9 +18,7 @@
namespace Apache.Ignite.Tests.Proto.BinaryTuple
{
using System;
- using System.Collections;
using System.Linq;
- using System.Numerics;
using Ignite.Sql;
using Internal.Proto.BinaryTuple;
using Internal.Table;
diff --git
a/modules/platforms/dotnet/Apache.Ignite.Tests/Proto/ColocationHashTests.cs
b/modules/platforms/dotnet/Apache.Ignite.Tests/Proto/ColocationHashTests.cs
index e304cfd6c4..a41dbf7dd7 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Tests/Proto/ColocationHashTests.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Tests/Proto/ColocationHashTests.cs
@@ -18,11 +18,9 @@
namespace Apache.Ignite.Tests.Proto;
using System;
-using System.Collections;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
-using System.Numerics;
using System.Reflection;
using System.Threading.Tasks;
using Ignite.Compute;
diff --git
a/modules/platforms/dotnet/Apache.Ignite.Tests/Sql/ColumnTypeExtensionsTests.cs
b/modules/platforms/dotnet/Apache.Ignite.Tests/Sql/ColumnTypeExtensionsTests.cs
index ce95c69e4f..d966861974 100644
---
a/modules/platforms/dotnet/Apache.Ignite.Tests/Sql/ColumnTypeExtensionsTests.cs
+++
b/modules/platforms/dotnet/Apache.Ignite.Tests/Sql/ColumnTypeExtensionsTests.cs
@@ -28,9 +28,7 @@ using NUnit.Framework;
/// </summary>
public class ColumnTypeExtensionsTests
{
- private static readonly ColumnType[] SqlColumnTypes =
Enum.GetValues<ColumnType>()
- .Where(x => x != ColumnType.Bitmask && x != ColumnType.Number)
- .ToArray();
+ private static readonly ColumnType[] SqlColumnTypes =
Enum.GetValues<ColumnType>().ToArray();
[TestCaseSource(nameof(SqlColumnTypes))]
public void TestToClrType(ColumnType columnType) =>
diff --git a/modules/platforms/dotnet/Apache.Ignite.Tests/Sql/SqlTests.cs
b/modules/platforms/dotnet/Apache.Ignite.Tests/Sql/SqlTests.cs
index d9e9cea5dd..4334675f28 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Tests/Sql/SqlTests.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Tests/Sql/SqlTests.cs
@@ -19,13 +19,11 @@ namespace Apache.Ignite.Tests.Sql
{
using System;
using System.Collections.Generic;
- using System.Collections.ObjectModel;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Threading.Tasks;
using Ignite.Sql;
using Ignite.Table;
- using Internal.Common;
using Microsoft.Extensions.Logging.Abstractions;
using NodaTime;
using NUnit.Framework;
diff --git
a/modules/platforms/dotnet/Apache.Ignite.Tests/Table/DataStreamerTests.cs
b/modules/platforms/dotnet/Apache.Ignite.Tests/Table/DataStreamerTests.cs
index 3846686a8d..e5b64ff070 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Tests/Table/DataStreamerTests.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Tests/Table/DataStreamerTests.cs
@@ -18,11 +18,9 @@
namespace Apache.Ignite.Tests.Table;
using System;
-using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Linq;
-using System.Numerics;
using System.Runtime.CompilerServices;
using System.Threading;
using System.Threading.Tasks;
diff --git
a/modules/platforms/dotnet/Apache.Ignite.Tests/Table/RecordViewBinaryTests.cs
b/modules/platforms/dotnet/Apache.Ignite.Tests/Table/RecordViewBinaryTests.cs
index 06e5e05f78..edb3fd879e 100644
---
a/modules/platforms/dotnet/Apache.Ignite.Tests/Table/RecordViewBinaryTests.cs
+++
b/modules/platforms/dotnet/Apache.Ignite.Tests/Table/RecordViewBinaryTests.cs
@@ -18,7 +18,6 @@
namespace Apache.Ignite.Tests.Table
{
using System;
- using System.Collections;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
diff --git
a/modules/platforms/dotnet/Apache.Ignite.Tests/Table/RecordViewPocoTests.cs
b/modules/platforms/dotnet/Apache.Ignite.Tests/Table/RecordViewPocoTests.cs
index 893815406e..0461fc942f 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Tests/Table/RecordViewPocoTests.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Tests/Table/RecordViewPocoTests.cs
@@ -18,7 +18,6 @@
namespace Apache.Ignite.Tests.Table
{
using System;
- using System.Collections;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
diff --git a/modules/platforms/dotnet/Apache.Ignite/Compute/ITaskExecution.cs
b/modules/platforms/dotnet/Apache.Ignite/Compute/ITaskExecution.cs
index 920378aeb3..f007978f30 100644
--- a/modules/platforms/dotnet/Apache.Ignite/Compute/ITaskExecution.cs
+++ b/modules/platforms/dotnet/Apache.Ignite/Compute/ITaskExecution.cs
@@ -18,7 +18,6 @@
namespace Apache.Ignite.Compute;
using System;
-using System.Collections;
using System.Collections.Generic;
using System.Threading.Tasks;
diff --git
a/modules/platforms/dotnet/Apache.Ignite/Internal/Proto/BinaryTuple/BinaryTupleBuilder.cs
b/modules/platforms/dotnet/Apache.Ignite/Internal/Proto/BinaryTuple/BinaryTupleBuilder.cs
index 2aa8145b6d..6997c52cd7 100644
---
a/modules/platforms/dotnet/Apache.Ignite/Internal/Proto/BinaryTuple/BinaryTupleBuilder.cs
+++
b/modules/platforms/dotnet/Apache.Ignite/Internal/Proto/BinaryTuple/BinaryTupleBuilder.cs
@@ -19,7 +19,6 @@ namespace Apache.Ignite.Internal.Proto.BinaryTuple
{
using System;
using System.Buffers.Binary;
- using System.Collections;
using System.Diagnostics;
using System.Numerics;
using System.Runtime.InteropServices;
diff --git
a/modules/platforms/dotnet/Apache.Ignite/Internal/Proto/BinaryTuple/BinaryTupleReader.cs
b/modules/platforms/dotnet/Apache.Ignite/Internal/Proto/BinaryTuple/BinaryTupleReader.cs
index 2f54705b49..8568793522 100644
---
a/modules/platforms/dotnet/Apache.Ignite/Internal/Proto/BinaryTuple/BinaryTupleReader.cs
+++
b/modules/platforms/dotnet/Apache.Ignite/Internal/Proto/BinaryTuple/BinaryTupleReader.cs
@@ -448,8 +448,6 @@ namespace Apache.Ignite.Internal.Proto.BinaryTuple
ColumnType.Boolean => GetBoolNullable(index),
ColumnType.Period => GetPeriodNullable(index),
ColumnType.Duration => GetDurationNullable(index),
- ColumnType.Bitmask => throw new
IgniteClientException(ErrorGroups.Client.Protocol, "Unsupported type: " +
columnType),
- ColumnType.Number => throw new
IgniteClientException(ErrorGroups.Client.Protocol, "Unsupported type: " +
columnType),
_ => throw new
IgniteClientException(ErrorGroups.Client.Protocol, "Unsupported type: " +
columnType)
};
diff --git
a/modules/platforms/dotnet/Apache.Ignite/Internal/Sql/ColumnTypeExtensions.cs
b/modules/platforms/dotnet/Apache.Ignite/Internal/Sql/ColumnTypeExtensions.cs
index 3e559edf54..1723e59663 100644
---
a/modules/platforms/dotnet/Apache.Ignite/Internal/Sql/ColumnTypeExtensions.cs
+++
b/modules/platforms/dotnet/Apache.Ignite/Internal/Sql/ColumnTypeExtensions.cs
@@ -18,10 +18,8 @@
namespace Apache.Ignite.Internal.Sql;
using System;
-using System.Collections;
using System.Collections.Generic;
using System.Linq;
-using System.Numerics;
using Ignite.Sql;
using NodaTime;
@@ -32,12 +30,10 @@ internal static class ColumnTypeExtensions
{
private static readonly IReadOnlyDictionary<Type, ColumnType> ClrToSql =
Enum.GetValues<ColumnType>()
- .Where(x => x != ColumnType.Bitmask && x != ColumnType.Number)
.ToDictionary(x => x.ToClrType(), x => x);
private static readonly IReadOnlyDictionary<Type, string> ClrToSqlName =
Enum.GetValues<ColumnType>()
- .Where(x => x != ColumnType.Period && x != ColumnType.Duration &&
x != ColumnType.Bitmask && x != ColumnType.Number)
.ToDictionary(x => x.ToClrType(), x => x.ToSqlTypeName());
/// <summary>
@@ -65,8 +61,6 @@ internal static class ColumnTypeExtensions
ColumnType.ByteArray => typeof(byte[]),
ColumnType.Period => typeof(Period),
ColumnType.Duration => typeof(Duration),
- ColumnType.Bitmask => throw new InvalidOperationException($"Invalid
{nameof(ColumnType)}: {columnType}"),
- ColumnType.Number => throw new InvalidOperationException($"Invalid
{nameof(ColumnType)}: {columnType}"),
_ => throw new InvalidOperationException($"Invalid
{nameof(ColumnType)}: {columnType}")
};
@@ -108,8 +102,6 @@ internal static class ColumnTypeExtensions
ColumnType.ByteArray => "varbinary",
ColumnType.Period => "interval",
ColumnType.Duration => "duration",
- ColumnType.Bitmask => throw new
InvalidOperationException($"Unsupported {nameof(ColumnType)}: {columnType}"),
- ColumnType.Number => throw new InvalidOperationException($"Unsupported
{nameof(ColumnType)}: {columnType}"),
_ => throw new InvalidOperationException($"Unsupported
{nameof(ColumnType)}: {columnType}")
};
diff --git a/modules/platforms/dotnet/Apache.Ignite/Internal/Sql/Sql.cs
b/modules/platforms/dotnet/Apache.Ignite/Internal/Sql/Sql.cs
index 3bcf9eacf8..ac8cd34dd8 100644
--- a/modules/platforms/dotnet/Apache.Ignite/Internal/Sql/Sql.cs
+++ b/modules/platforms/dotnet/Apache.Ignite/Internal/Sql/Sql.cs
@@ -26,7 +26,6 @@ namespace Apache.Ignite.Internal.Sql
using Ignite.Table;
using Ignite.Transactions;
using Linq;
- using NodaTime;
using Proto;
using Proto.BinaryTuple;
using Proto.MsgPack;
@@ -135,8 +134,6 @@ namespace Apache.Ignite.Internal.Sql
ColumnType.ByteArray => reader.GetBytes(idx),
ColumnType.Period => reader.GetPeriod(idx),
ColumnType.Duration => reader.GetDuration(idx),
- ColumnType.Bitmask => throw new
ArgumentOutOfRangeException(nameof(col.Type), col.Type, "Unknown SQL column
type."),
- ColumnType.Number => throw new
ArgumentOutOfRangeException(nameof(col.Type), col.Type, "Unknown SQL column
type."),
_ => throw new ArgumentOutOfRangeException(nameof(col.Type),
col.Type, "Unknown SQL column type.")
};
}
diff --git
a/modules/platforms/dotnet/Apache.Ignite/Internal/Table/Serialization/BinaryTupleMethods.cs
b/modules/platforms/dotnet/Apache.Ignite/Internal/Table/Serialization/BinaryTupleMethods.cs
index de2f58f617..3cba2fb036 100644
---
a/modules/platforms/dotnet/Apache.Ignite/Internal/Table/Serialization/BinaryTupleMethods.cs
+++
b/modules/platforms/dotnet/Apache.Ignite/Internal/Table/Serialization/BinaryTupleMethods.cs
@@ -18,9 +18,7 @@
namespace Apache.Ignite.Internal.Table.Serialization
{
using System;
- using System.Collections;
using System.Collections.Generic;
- using System.Numerics;
using System.Reflection;
using NodaTime;
using Proto.BinaryTuple;
diff --git a/modules/platforms/dotnet/Apache.Ignite/Sql/ColumnType.cs
b/modules/platforms/dotnet/Apache.Ignite/Sql/ColumnType.cs
index a806ca2554..20f1b4d3d4 100644
--- a/modules/platforms/dotnet/Apache.Ignite/Sql/ColumnType.cs
+++ b/modules/platforms/dotnet/Apache.Ignite/Sql/ColumnType.cs
@@ -26,6 +26,7 @@ namespace Apache.Ignite.Sql
"Microsoft.Naming",
"CA1720:IdentifiersShouldNotContainTypeNames",
Justification = "Ignite-specific SQL column type names are required.")]
+ [SuppressMessage("Design", "CA1027:Mark enums with FlagsAttribute",
Justification = "Not a flags enum.")]
public enum ColumnType
{
/** Null. */
@@ -70,9 +71,6 @@ namespace Apache.Ignite.Sql
/** 128-bit UUID. */
Uuid = 13,
- /** Bit mask. */
- Bitmask = 14,
-
/** String. */
String = 15,
@@ -83,9 +81,6 @@ namespace Apache.Ignite.Sql
Period = 17,
/** Time interval. */
- Duration = 18,
-
- /** Number. */
- Number = 19
+ Duration = 18
}
}