Example #1
0
        public void TestSignaturesV3_X_X()
        {
            // Validate ToLocalIterator
            var data = new List <GenericRow>
            {
                new GenericRow(new object[] { "Alice", 20 }),
                new GenericRow(new object[] { "Bob", 30 })
            };
            var schema = new StructType(new List <StructField>()
            {
                new StructField("Name", new StringType()),
                new StructField("Age", new IntegerType())
            });
            DataFrame         df       = _spark.CreateDataFrame(data, schema);
            IEnumerable <Row> actual   = df.ToLocalIterator(true).ToArray();
            IEnumerable <Row> expected = data.Select(r => new Row(r.Values, schema));

            Assert.Equal(expected, actual);

            Assert.IsType <DataFrame>(df.Observe("metrics", Count("Name").As("CountNames")));

            Assert.IsType <Row[]>(_df.Tail(1).ToArray());

            _df.PrintSchema(1);

            _df.Explain("simple");
            _df.Explain("extended");
            _df.Explain("codegen");
            _df.Explain("cost");
            _df.Explain("formatted");
        }