コード例 #1
0
        public void TestSignaturesV2_3_X()
        {
            RuntimeConfig conf = _spark.Conf();

            conf.Set("stringKey", "stringValue");
            conf.Set("boolKey", false);
            conf.Set("longKey", 1234L);

            Assert.Equal("stringValue", conf.Get("stringKey"));
            Assert.Equal("false", conf.Get("boolKey"));
            Assert.Equal("1234", conf.Get("longKey"));

            conf.Unset("stringKey");
            Assert.Equal("defaultValue", conf.Get("stringKey", "defaultValue"));
            Assert.Equal("false", conf.Get("boolKey", "true"));
        }
コード例 #2
0
        public void TestSignaturesV2_4_X()
        {
            RuntimeConfig conf = _spark.Conf();

            conf.Set("stringKey", "stringValue");
            conf.Set("boolKey", false);
            conf.Set("longKey", 1234L);

            Assert.Equal("stringValue", conf.Get("stringKey"));
            Assert.Equal("false", conf.Get("boolKey"));
            Assert.Equal("1234", conf.Get("longKey"));

            conf.Unset("stringKey");
            Assert.Equal("defaultValue", conf.Get("stringKey", "defaultValue"));
            Assert.Equal("false", conf.Get("boolKey", "true"));

            Assert.True(conf.IsModifiable("spark.sql.streaming.checkpointLocation"));
            Assert.False(conf.IsModifiable("missingKey"));
        }
コード例 #3
0
        public void TestUnicode()
        {
            string expected =
                "①Ⅻㄨㄩ 啊阿鼾齄丂丄狚狛狜狝﨨﨩ˊˋ˙–⿻〇㐀㐁㐃㐄䶴䶵U1[]U2[]U3[]";

            RuntimeConfig conf = _spark.Conf();
            string        key  = "SerDeTests.TestUnicode";

            conf.Set(key, expected);

            string actual = conf.Get(key);

            Assert.Equal(expected, actual);
        }