Converts a raw column value of type Variant to a JavaScript value.

@param {String} rawColumnValue
@param {Object} column
@param {Object} context

@returns {Object | Array}
4916
function convertRawVariant(rawColumnValue, column, context)
{
  var ret;

  // if the input is a non-empty string, convert it to a json object
  if (Util.string.isNotNullOrEmpty(rawColumnValue))
  {
    try
    {
      ret = eval("(" + rawColumnValue + ")");
    }
    catch (parseError)
    {
      // TODO: log the error

      // throw the error
      throw parseError;
    }
  }

  return ret;
}
878557
function convertRawTime(rawColumnValue, column, context)
{
  var columnScale = column.getScale();

  // the values might be big so use BigNumber to do arithmetic
  var valFracSecsBig =
      new BigNumber(rawColumnValue).times(Math.pow(10, columnScale));

  return convertRawTimestampHelper(
      valFracSecsBig,
      columnScale,
      'UTC',
      context.format).toSfTime();
}
378964
function _setRaw(raw: Object, key: string, value: any, columnSchema: ColumnSchema): void {
  const { type, isOptional } = columnSchema

  // If the value is wrong type or invalid, it's set to `null` (if optional) or empty value ('', 0, false)
  if (type === 'string') {
    if (typeof value === 'string') {
      raw[key] = value
    } else {
      raw[key] = isOptional ? null : ''
    }
  } else if (type === 'boolean') {
    if (typeof value === 'boolean') {
      raw[key] = value
    } else if (value === 1 || value === 0) {
      // Exception to the standard rule — because SQLite turns true/false into 1/0
      raw[key] = Boolean(value)
    } else {
      raw[key] = isOptional ? null : false
    }
  } else {
    // type = number
    // Treat NaN and Infinity as null
    if (isValidNumber(value)) {
      raw[key] = value
    } else {
      raw[key] = isOptional ? null : 0
    }
  }
}
267712
private IndexMetadata buildLegacyIndex(RawColumn raw, ColumnMetadata column) {
    if (raw.indexName == null) {
      return null;
    }
    return new DefaultIndexMetadata(
        column.getKeyspace(),
        column.getParent(),
        CqlIdentifier.fromInternal(raw.indexName),
        IndexKind.valueOf(raw.indexType),
        buildLegacyIndexTarget(column, raw.indexOptions),
        raw.indexOptions);
  }
394051
function(fullContext, activeDimensions, usedValues, setting) {
        var height = this.dimensionsList.length;
        var newContext = new Array(height);
        for(var i=0; i<height; i++) {
            newContext[i] = 0;
        }
        var activeIndex = 0;
        for(i=0; i<fullContext.length; i++) {
            if(activeDimensions[i]) {
                var dimensionName = this.dimensionsList[activeIndex];
                var contextValue = fullContext[i];
                if(contextValue.constructor === Array) {
                    var newValue = [];
                    for(var k=0; k<contextValue.length; k++) {
                        var valueChunk = contextValue[k];
                        if(usedValues[dimensionName][valueChunk] === 2) {
                            newValue.push(this.valueToNumber[dimensionName][valueChunk]);
                        } else {
                            console.log('WARNING: invalid value "' + valueChunk + '" for dimension "' +
                                dimensionName + '" in settings ' + JSON.stringify(setting));
                        }
                    }
                    if(newValue.length === 0) {
                        return;
                    }
                    newContext[activeIndex] = newValue;
                } else {
                    if(usedValues[dimensionName][contextValue] === 2) {
                        newContext[activeIndex] = this.valueToNumber[dimensionName][contextValue];
                    } else if(contextValue !== DEFAULT) {
                        console.log('WARNING: invalid value "' + contextValue + '" for dimension "' +
                            dimensionName + '" in settings ' + JSON.stringify(setting));
                        return;
                    }
                }
                activeIndex++;
            }
        }
        return newContext;
    }
622856
function(col, defaultValue) {
    var lhs = '  ' + prefix + '.' + col.getName() + ' = ';
    body.push(lhs + (col.isNullable() ? 'null' : defaultValue) + ';');
  }
518502
public static ColumnValue mov(String column, Serializable value) {
        return new ColumnValue(column, MOV, value);
    }
1098735
public Double getColumnValueAsDouble(final int col, final double defaultValue) {
		Double value = getColumnValueAsDouble(col);
		if (value == null) {
			value = defaultValue;
		}
		return value;
	}
315471
function parseStoredType(value /* , context */) {
    const regex = /^(\w+)(\((.*?)\))?$/;
    const result = value.match(regex);
    if (!result) throw new ImplementationError(`Invalid storedType "${value}"`);

    const type = result[1];
    const options = {};
    if (result[2]) {
        const regexOptions = /^(\w+)=(.*)/;
        result[3].split(';').forEach(o => {
            const resultOptions = o.match(regexOptions);
            if (!resultOptions) throw new ImplementationError(`Invalid storedType "${value}"`);
            options[resultOptions[1]] = resultOptions[2];
        });
    }

    return { type, options };
}
60786
private Object getFieldValueViaCQL(Object thriftColumnValue, Attribute attribute)
    {
        PropertyAccessor<?> accessor = PropertyAccessorFactory.getPropertyAccessor((Field) attribute.getJavaMember());
        Object objValue;
        try
        {
            if (CassandraDataTranslator.isCassandraDataTypeClass(((AbstractAttribute) attribute).getBindableJavaType()))
            {
                objValue = CassandraDataTranslator.decompose(((AbstractAttribute) attribute).getBindableJavaType(),
                        thriftColumnValue, true);
                return objValue;
            }
            else
            {
                objValue = accessor.fromBytes(((AbstractAttribute) attribute).getBindableJavaType(),
                        (byte[]) thriftColumnValue);
                return objValue;
            }
        }
        catch (PropertyAccessException pae)
        {
            log.warn("Error while setting field{} value via CQL, Caused by: .", attribute.getName(), pae);
        }
        return null;
    }
735788
function (columns, values) {
            return [this.insertSql(columns, sql.literal('VALUES ' + values.map(
                function (r) {
                    return this.literal(toArray(r));
                }, this).join(this._static.COMMA_SEPARATOR)))];
        }
807518
function getColumnValue(columnIdentifier)
  {
    // resolve the column identifier to the correct column if possible
    var column = resolveColumnIdentifierToColumn(
        columns, columnIdentifier, mapColumnNameToIndices);

    return column ? column.getRowValue(this) : undefined;
  }
997740
public void setSubmittedValue(final FacesContext context, final String rowKey, final int col, final String value) {
        submittedValues.put(new SheetRowColIndex(rowKey, col), value);
    }
292961
private Object composeColumnValue(CqlMetadata cqlMetadata, byte[] thriftColumnValue, byte[] thriftColumnName) {
        Map<ByteBuffer, String> schemaTypes = cqlMetadata.getValue_types();
        AbstractType<?> type = null;
        try {
            type = TypeParser.parse(schemaTypes.get(ByteBuffer.wrap(thriftColumnName)));
        } catch (SyntaxException | ConfigurationException ex) {
            log.error(ex.getMessage());
            throw new KunderaException("Error while deserializing column value " + ex);
        }
        if (type.isCollection()) {
            return ((CollectionSerializer) type.getSerializer())
                .deserializeForNativeProtocol(ByteBuffer.wrap(thriftColumnValue), ProtocolVersion.V2);
        }
        return type.compose(ByteBuffer.wrap(thriftColumnValue));
    }
1358701
function () {
		var columns = this.columns,
			col = columns.length, 
			row,
			val,
			floatVal,
			trimVal,
			dateVal;
			
		while (col--) {
			row = columns[col].length;
			while (row--) {
				val = columns[col][row];
				floatVal = parseFloat(val);
				trimVal = this.trim(val);

				/*jslint eqeq: true*/
				if (trimVal == floatVal) { // is numeric
				/*jslint eqeq: false*/
					columns[col][row] = floatVal;
					
					// If the number is greater than milliseconds in a year, assume datetime
					if (floatVal > 365 * 24 * 3600 * 1000) {
						columns[col].isDatetime = true;
					} else {
						columns[col].isNumeric = true;
					}					
				
				} else { // string, continue to determine if it is a date string or really a string
					dateVal = this.parseDate(val);
					
					if (col === 0 && typeof dateVal === 'number' && !isNaN(dateVal)) { // is date
						columns[col][row] = dateVal;
						columns[col].isDatetime = true;
					
					} else { // string
						columns[col][row] = trimVal === '' ? null : trimVal;
					}
				}
				
			}
		}
	}
72112
private ByteBuffer columnValueAsBytes(ByteBuffer columnName, String columnFamilyName, String columnValue)
    {
        CfDef columnFamilyDef = getCfDef(columnFamilyName);
        AbstractType<?> defaultValidator = getFormatType(columnFamilyDef.default_validation_class);

        for (ColumnDef columnDefinition : columnFamilyDef.getColumn_metadata())
        {
            byte[] currentColumnName = columnDefinition.getName();

            if (ByteBufferUtil.compare(currentColumnName, columnName) == 0)
            {
                try
                {
                    String validationClass = columnDefinition.getValidation_class();
                    return getBytesAccordingToType(columnValue, getFormatType(validationClass));
                }
                catch (Exception e)
                {
                    throw new RuntimeException(e);
                }
            }
        }

        return defaultValidator.fromString(columnValue);
    }
1066162
def get(self, column, useMethod=True, **context):
        

        # look for shortcuts (dot-noted path)
        if isinstance(column, (str, unicode)) and '.' in column:
            # create the sub context
            base_context = context.copy()
            base_context['inflated'] = True

            # generate the expansion to avoid unnecessary lookups
            parts = column.split('.')

            # include the target if it is a reference
            if isinstance(self.schema().column(column), orb.ReferenceColumn):
                expand_path_index = None

            # otherwise, just get to the end column
            else:
                expand_path_index = -1

            value = self
            for i, part in enumerate(parts[:-1]):
                sub_context = base_context.copy()
                expand_path = '.'.join(parts[i+1:expand_path_index])

                try:
                    sub_expand = sub_context['expand']
                except KeyError:
                    sub_context['expand'] = expand_path
                else:
                    if isinstance(sub_expand, basestring):
                        sub_context['expand'] += ',{0}'.format(expand_path)
                    elif isinstance(sub_expand, list):
                        sub_expand.append(expand_path)
                    elif isinstance(sub_expand, dict):
                        curr = {}
                        for x in xrange(len(parts) - 1 + (expand_path_index or 0), i, -1):
                            curr = {parts[x]: curr}
                        sub_expand.update(curr)

                value = value.get(part, useMethod=useMethod, **sub_context)
                if value is None:
                    return None

            return value.get(parts[-1], useMethod=useMethod, **context)

        # otherwise, lookup a column
        else:
            my_context = self.context()

            for k, v in my_context.raw_values.items():
                if k not in orb.Context.QueryFields:
                    context.setdefault(k, v)

            sub_context = orb.Context(**context)

            # normalize the given column
            if isinstance(column, orb.Column):
                col = column
            else:
                col = self.schema().column(column, raise_=False)

                if not col:
                    if isinstance(column, orb.Collector):
                        collector = column
                    else:
                        collector = self.schema().collector(column)

                    if collector:
                        try:
                            return self.__cache[collector][sub_context]
                        except KeyError:
                            records = collector(self, useMethod=useMethod, context=sub_context)
                            self.__cache[collector][sub_context] = records
                            return records
                    else:
                        raise errors.ColumnNotFound(schema=self.schema(), column=column)

            # don't inflate if the requested value is a field
            if sub_context.inflated is None and isinstance(col, orb.ReferenceColumn):
                sub_context.inflated = column != col.field()

            # lookup the shortuct value vs. the local one (bypass for views
            # since they define tables for shortcuts)
            if col.shortcut() and not isinstance(self, orb.View):
                return self.get(col.shortcut(), **context)

            # call the getter method fot this record if one exists
            elif useMethod and col.gettermethod():
                return col.gettermethod()(self, context=sub_context)

            else:
                # ensure content is actually loaded
                if self.isRecord() and self.__delayed:
                    self.__delayed = False
                    self.read()

                # grab the current value
                with ReadLocker(self.__dataLock):
                    old_value, value = self.__values.get(col.name(), (None, None))

                # return a reference when desired
                out_value = col.restore(value, sub_context)
                if isinstance(out_value, orb.Model) and not isinstance(value, orb.Model):
                    with WriteLocker(self.__dataLock):
                        self.__values[col.name()] = (old_value, out_value)

                return out_value