mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Sumo ensemble parameters: handle string properties.
This commit is contained in:
@@ -101,3 +101,25 @@ QString RifArrowTools::readFirstRowsOfTable( const QByteArray& contents )
|
||||
|
||||
return tableText;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<std::string> RifArrowTools::chunkedArrayToStringVector( const std::shared_ptr<arrow::ChunkedArray>& chunkedArray )
|
||||
{
|
||||
std::vector<std::string> result;
|
||||
|
||||
for ( int i = 0; i < chunkedArray->num_chunks(); ++i )
|
||||
{
|
||||
auto chunk = std::static_pointer_cast<arrow::StringArray>( chunkedArray->chunk( i ) );
|
||||
for ( int j = 0; j < chunk->length(); ++j )
|
||||
{
|
||||
if ( !chunk->IsNull( j ) )
|
||||
{
|
||||
result.push_back( chunk->Value( j ).data() );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -19,7 +19,9 @@
|
||||
#pragma once
|
||||
|
||||
#undef signals
|
||||
#include <arrow/array/array_binary.h>
|
||||
#include <arrow/array/array_primitive.h>
|
||||
|
||||
#define signals Q_SIGNALS
|
||||
|
||||
#include <limits>
|
||||
@@ -67,5 +69,8 @@ std::vector<CType> chunkedArrayToVector( const std::shared_ptr<arrow::ChunkedArr
|
||||
return result;
|
||||
}
|
||||
|
||||
std::vector<std::string> chunkedArrayToStringVector( const std::shared_ptr<arrow::ChunkedArray>& chunkedArray );
|
||||
|
||||
QString readFirstRowsOfTable( const QByteArray& contents );
|
||||
|
||||
}; // namespace RifArrowTools
|
||||
|
||||
Reference in New Issue
Block a user