language-extensions/R/test/src/RExtensionGetResultColumnTests.cpp
//----------------------------------------------------------------------------------------------
// Name: GetPartitioningIntegerResultColumnsTest
//
// Description:
//  Test GetResultColumn with default script expecting an OutputDataSet of Integer columns.
//  When partitionByNumber is set, we are in the partitioning case,
//  which works the same way as streaming - each partition comes in a separate
//  chunk. Both nullable and non-nullable columns must return as nullable.
//  This is because it is not predictable if the upcoming partition of data will contain nulls.
//
GetPartitioningIntegerResultColumnsTest
Description:
Test GetResultColumn with default script expecting an OutputDataSet of Integer columns.
When partitionByNumber is set, we are in the partitioning case,
which works the same way as streaming - each partition comes in a separate
chunk. Both nullable and non-nullable columns must return as nullable.
This is because it is not predictable if the upcoming partition of data will contain nulls.
GetPartitioningIntegerResultColumnsTest Description : Test GetResultColumn with default script expecting an OutputDataSet of Integer columns . When partitionByNumber is set we are in the partitioning case which works the same way as streaming - each partition comes in a separate chunk . Both nullable and non - nullable columns must return as nullable . This is because it is not predictable if the upcoming partition of data will contain nulls .
TEST_F(RExtensionApiTests, GetPartitioningIntegerResultColumnsTest)
	{
		InitializeSession(
			(*m_integerInfo).GetColumnsNumber(),  inputSchemaColumnsNumber
			m_scriptString
			);
		 Turning partitioning on for a non-nullable column of integers.
		InitializeColumns<SQLINTEGER, SQL_C_SLONG>(m_partition_integerInfo.get());
		Execute<SQLINTEGER, Rcpp::IntegerVector, SQL_C_SLONG>(
			ColumnInfo<SQLINTEGER>::sm_rowsNumber,
			(*m_partition_integerInfo).m_dataSet.data(),
			(*m_partition_integerInfo).m_strLen_or_Ind.data(),
			(*m_partition_integerInfo).m_columnNames,
			false);   validate
		GetResultColumn(0,  columnNumber
			SQL_C_SLONG,    dataType
			m_IntSize,      columnSize
			0,              decimalDigits
			SQL_NULLABLE);  must be verified as nullable
		GetResultColumn(1,  columnNumber
			SQL_C_SLONG,    dataType
			m_IntSize,      columnSize
			0,              decimalDigits
			SQL_NULLABLE);  nullable
	}
TEST_F ( RExtensionApiTests , GetPartitioningIntegerResultColumnsTest ) { InitializeSession ( ( * m_integerInfo ) . GetColumnsNumber ( ) , m_scriptString ) ; InitializeColumns < SQLINTEGER , SQL_C_SLONG > ( m_partition_integerInfo . get ( ) ) ; Execute < SQLINTEGER , Rcpp :: IntegerVector , SQL_C_SLONG > ( ColumnInfo < SQLINTEGER > :: sm_rowsNumber , ( * m_partition_integerInfo ) . m_dataSet . data ( ) , ( * m_partition_integerInfo ) . m_strLen_or_Ind . data ( ) , ( * m_partition_integerInfo ) . m_columnNames , false ) ; GetResultColumn ( 0 , SQL_C_SLONG , m_IntSize , 0 , SQL_NULLABLE ) ; GetResultColumn ( 1 , SQL_C_SLONG , m_IntSize , 0 , SQL_NULLABLE ) ; }
Name: GetPartitioningIntegerResultColumnsTest
Description:
Test GetResultColumn with default script expecting an OutputDataSet of Integer columns.
Name : GetPartitioningIntegerResultColumnsTest Description : Test GetResultColumn with default script expecting an OutputDataSet of Integer columns .
// Initialize with a default Session that prints Hello RExtension // and assigns InputDataSet to OutputDataSet // // inputSchemaColumnsNumber // Turning partitioning on for a non-nullable column of integers. // // validate // columnNumber // dataType // columnSize // decimalDigits // must be verified as nullable // columnNumber // dataType // columnSize // decimalDigits // nullable