Skip to content

Commit

Permalink
chore: refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
NguyenHoangSon96 committed Dec 17, 2024
1 parent 7af2d1e commit a352349
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
5 changes: 4 additions & 1 deletion Client/InfluxDBClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,10 @@ public InfluxDBClient() : this(
var row = new object?[columnCount];
for (var j = 0; j < columnCount; j++)
{
if (batch.Column(j) is not ArrowArray array) continue;
if (batch.Column(j) is not ArrowArray array)
{
continue;
}
row[j] = TypeCasting.GetMappedValue(
batch.Schema.FieldsList[j],
array.GetObjectValue(i)
Expand Down
8 changes: 5 additions & 3 deletions Client/Internal/RecordBatchConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@

namespace InfluxDB3.Client.Internal;

public static class RecordBatchConverter
internal static class RecordBatchConverter
{
/// <summary>
/// Convert a given row of data from RecordBatch to PointDataValues
/// </summary>
/// <param name="recordBatch">The RecordBatch to get data from</param>
/// <param name="rowNumber">The row number</param>
/// <returns>The PointDataValues</returns>
public static PointDataValues ConvertToPointDataValue(RecordBatch recordBatch, int rowNumber)
internal static PointDataValues ConvertToPointDataValue(RecordBatch recordBatch, int rowNumber)
{
PointDataValues point = new();
for (var columnIndex = 0; columnIndex < recordBatch.ColumnCount; columnIndex++)
Expand All @@ -23,8 +23,10 @@ public static PointDataValues ConvertToPointDataValue(RecordBatch recordBatch, i
var fullName = schema.Name;

if (recordBatch.Column(columnIndex) is not ArrowArray array)
{
continue;

}

var objectValue = array.GetObjectValue(rowNumber);
if (fullName is "measurement" or "iox::measurement" &&
objectValue is string value)
Expand Down
4 changes: 2 additions & 2 deletions Client/Internal/TimestampConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace InfluxDB3.Client.Internal;

public static class TimestampConverter
internal static class TimestampConverter
{
private static readonly DateTime EpochStart = new(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);

Expand All @@ -12,7 +12,7 @@ public static class TimestampConverter
/// </summary>
/// <param name="dateTime">the Datetime object</param>
/// <returns>the time in nanosecond</returns>
public static BigInteger GetNanoTime(DateTime dateTime)
internal static BigInteger GetNanoTime(DateTime dateTime)
{
var utcTimestamp = dateTime.Kind switch
{
Expand Down

0 comments on commit a352349

Please sign in to comment.