Skip to content

Commit 1336cda

Browse files
committed
Address review: static lambda, remove tz member, remove redundant override
- Make viewToString lambda static in createColumnDispatcher - Remove m_defaultTimezone member, validate tz inline and discard - Remove redundant doReadNextValue override from LambdaReader (base class handles it)
1 parent c3332f6 commit 1336cda

4 files changed

Lines changed: 4 additions & 14 deletions

File tree

cpp/csp/adapters/arrow/ArrowFieldReader.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -190,15 +190,6 @@ class LambdaReader final : public TypedFieldReader<ValueT>
190190
return false;
191191
}
192192

193-
void doReadNextValue( int64_t row, void * optionalOut ) override
194-
{
195-
auto & out = *static_cast<std::optional<ValueT> *>( optionalOut );
196-
auto & typed = static_cast<const ArrowArrayT &>( *this -> m_column );
197-
if( typed.IsValid( row ) )
198-
out = m_extractFn( typed, row );
199-
else
200-
out.reset();
201-
}
202193

203194
private:
204195
ExtractFn m_extractFn;

cpp/csp/adapters/arrow/ColumnDispatcher.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ std::unique_ptr<ColumnDispatcher> createColumnDispatcher(
181181
{
182182
auto typeId = arrowField -> type() -> id();
183183
auto & name = arrowField -> name();
184-
auto viewToString = []( const auto & arr, int64_t i ) -> std::string {
184+
static auto viewToString = []( const auto & arr, int64_t i ) -> std::string {
185185
auto view = arr.GetView( i );
186186
return std::string( view.data(), view.size() );
187187
};

cpp/csp/adapters/parquet/ParquetInputAdapterManager.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,16 +189,16 @@ ParquetInputAdapterManager::ParquetInputAdapterManager( csp::Engine *engine, con
189189

190190
m_symbolColumn = properties.get<std::string>( "symbol_column", "" );
191191
m_timeColumn = properties.get<std::string>( "time_column", "" );
192-
m_defaultTimezone = properties.get<std::string>( "tz", "UTC" );
192+
auto tz = properties.get<std::string>( "tz", "UTC" );
193+
CSP_TRUE_OR_THROW_RUNTIME( tz == "UTC",
194+
"Only UTC default timezone is supported, got:" << tz );
193195
m_allowOverlappingPeriods = properties.get<bool>( "allow_overlapping_periods", false );
194196
m_allowMissingColumns = properties.get<bool>( "allow_missing_columns", false );
195197
properties.tryGet( "start_time", m_startTime );
196198
properties.tryGet( "end_time", m_endTime );
197199
properties.tryGet( "time_shift", m_time_shift );
198200

199201
CSP_TRUE_OR_THROW_RUNTIME( m_timeColumn != "", "Time column can't be empty" );
200-
CSP_TRUE_OR_THROW_RUNTIME( m_defaultTimezone == "UTC",
201-
"Only UTC default timezone is supported, got:" << m_defaultTimezone );
202202
}
203203

204204
ParquetInputAdapterManager::~ParquetInputAdapterManager() = default;

cpp/csp/adapters/parquet/ParquetInputAdapterManager.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,6 @@ class ParquetInputAdapterManager final : public csp::AdapterManager
166166
RecordBatchStreamSourcePtr m_streamSource;
167167
std::string m_symbolColumn;
168168
std::string m_timeColumn;
169-
std::string m_defaultTimezone;
170169
bool m_allowOverlappingPeriods;
171170
bool m_allowMissingColumns;
172171
std::optional<PushMode> m_pushMode;

0 commit comments

Comments
 (0)