Exemplo n.º 1
0
        public void Condition_Validations()
        {
            Assert.Throws <ArgumentNullException>
                (() => RowFilters.Condition(null, RowFilters.PassAllFilter(), RowFilters.PassAllFilter()));

            // The true/false mutations are allowed to be null.
            RowFilters.Condition(RowFilters.PassAllFilter(), null, null);
        }
Exemplo n.º 2
0
        public void Condition()
        {
            var filter = RowFilters.Condition(
                RowFilters.ColumnQualifierRegex("last_name"),
                RowFilters.RowSample(0.5),
                RowFilters.FamilyNameExact("address"));

            Assert.NotNull(filter.Condition);
            Assert.Equal(
                RowFilters.ColumnQualifierRegex("last_name"),
                filter.Condition.PredicateFilter);
            Assert.Equal(RowFilters.RowSample(0.5), filter.Condition.TrueFilter);
            Assert.Equal(RowFilters.FamilyNameExact("address"), filter.Condition.FalseFilter);
        }
Exemplo n.º 3
0
        // [END bigtable_filters_composing_interleave]

        // [START bigtable_filters_composing_condition]
        /// <summary>
        /// /// Read using a conditional filter from an existing table.
        ///</summary>
        /// <param name="projectId">Your Google Cloud Project ID.</param>
        /// <param name="instanceId">Your Google Cloud Bigtable Instance ID.</param>
        /// <param name="tableId">Your Google Cloud Bigtable table ID.</param>

        public string filterComposingCondition(string projectId = "YOUR-PROJECT-ID", string instanceId = "YOUR-INSTANCE-ID", string tableId = "YOUR-TABLE-ID")
        {
            // A filter that applies the label passed-filter IF the cell has the column qualifier
            // data_plan_10gb AND the value true, OTHERWISE applies the label filtered-out
            RowFilter filter = RowFilters.Condition(
                RowFilters.Chain(RowFilters.ColumnQualifierExact("data_plan_10gb"), RowFilters.ValueExact("true")),
                new RowFilter {
                ApplyLabelTransformer = "passed-filter"
            },
                new RowFilter {
                ApplyLabelTransformer = "filtered-out"
            }
                );

            return(readFilter(projectId, instanceId, tableId, filter));
        }
Exemplo n.º 4
0
 public void Condition_Validations()
 {
     // The true/false mutations are allowed to be null.
     RowFilters.Condition(RowFilters.PassAllFilter(), null, null);
 }