diff --git a/internal/tests/integration/dataframe_test.go b/internal/tests/integration/dataframe_test.go index ae9e06b..c4301a1 100644 --- a/internal/tests/integration/dataframe_test.go +++ b/internal/tests/integration/dataframe_test.go @@ -694,3 +694,59 @@ func TestDataFrame_FreqItems(t *testing.T) { assert.NoErrorf(t, err, "%+v", err) assert.Len(t, res, 1) } + +func TestDataFrame_Config_GetAll(t *testing.T) { + ctx, spark := connect() + result, err := spark.Config().GetAll(ctx) + assert.NoError(t, err, "%+v", err) + assert.Equal(t, "driver", (*result)["spark.executor.id"]) +} + +func TestDataFrame_Config_Get(t *testing.T) { + ctx, spark := connect() + keys := []string{ + "spark.executor.id", + } + result, err := spark.Config().Get(ctx, keys) + assert.NoError(t, err, "%+v", err) + assert.Equal(t, "driver", (*result)["spark.executor.id"]) +} + +func TestDataFrame_Config_GetWithDefault(t *testing.T) { + ctx, spark := connect() + keys := map[string]string{ + "spark.executor.id": "executor_id_not_set", + "spark.whatever": "whatever_not_set", + } + result, err := spark.Config().GetWithDefault(ctx, keys) + assert.NoError(t, err, "%+v", err) + assert.Equal(t, "driver", (*result)["spark.executor.id"]) + assert.Equal(t, "whatever_not_set", (*result)["spark.whatever"]) +} + +func TestDataFrame_Config_Set(t *testing.T) { + ctx, spark := connect() + err := spark.Config().Set(ctx, "spark.whatever", "whatever_set") + assert.NoError(t, err, "%+v", err) +} + +func TestDataFrame_Config_IsModifiable(t *testing.T) { + ctx, spark := connect() + keys := []string{ + "spark.executor.id", + } + result, err := spark.Config().IsModifiable(ctx, keys) + assert.NoError(t, err, "%+v", err) + assert.Equal(t, "false", (*result)["spark.executor.id"]) +} + +func TestDataFrame_Config_Unset(t *testing.T) { + ctx, spark := connect() + keys := []string{ + "spark.magnus", + } + err := spark.Config().Set(ctx, "spark.whatever", "whatever_set") + assert.NoError(t, err, "%+v", err) + err = spark.Config().Unset(ctx, keys) + assert.NoError(t, err, "%+v", err) +}