public IRouteValue Generate(PredicateInRightValue predicateRightValue, Column column, ParameterContext parameterContext)
        {
            ICollection <IComparable> routeValues = new LinkedList <IComparable>();
            SPITimeService            timeService = SPITimeService.GetInstance();

            foreach (var sqlExpression in predicateRightValue.SqlExpressions)
            {
                var routeValue = new ConditionValue(sqlExpression, parameterContext).GetValue();
                if (routeValue != null)
                {
                    routeValues.Add(routeValue);
                    continue;
                }
                if (ExpressionConditionUtils.IsNowExpression(sqlExpression))
                {
                    routeValues.Add(timeService.GetTime());
                }
            }
            return(routeValues.IsEmpty() ? null : new ListRouteValue(column.Name, column.TableName, routeValues));
        }
        private ShardingCondition CreateShardingCondition(string tableName, IEnumerator <string> columnNames,
                                                          InsertValueContext insertValueContext, ParameterContext parameterContext)
        {
            ShardingCondition result      = new ShardingCondition();
            SPITimeService    timeService = SPITimeService.GetInstance();


            foreach (var valueExpression in insertValueContext.GetValueExpressions())
            {
                string columnName = columnNames.Next();
                if (_shardingRule.IsShardingColumn(columnName, tableName))
                {
                    if (valueExpression is ISimpleExpressionSegment simpleExpressionSegment)
                    {
                        result.RouteValues.Add(new ListRouteValue(columnName, tableName,
                                                                  new List <IComparable>()
                        {
                            GetRouteValue(simpleExpressionSegment, parameterContext)
                        }));
                    }
                    else if (ExpressionConditionUtils.IsNowExpression(valueExpression))
                    {
                        result.RouteValues.Add(new ListRouteValue(columnName, tableName,
                                                                  new List <IComparable>()
                        {
                            timeService.GetTime()
                        }));
                    }
                    else if (ExpressionConditionUtils.IsNullExpression(valueExpression))
                    {
                        throw new ShardingException("Insert clause sharding column can't be null.");
                    }
                }
            }

            return(result);
        }