jayvynl / django-clickhouse-backend

Django clickhouse database backend.
MIT License
130 stars 21 forks source link

Window func not working #72

Closed PavelIgin closed 5 months ago

PavelIgin commented 10 months ago

i want user this code but Window() func not working exclude_next = Q(value=F('next_value')) | Q(value=F('second_next_value')) exclude_prev = Q(value=F('prev_value')) | Q(value=F('second_prev_value')) queryset = ValueChart.objects.filter(signal=signal.id, date_time__range=( validated_data.get('date_time_before', None), validated_data.get('date_time_after', None)) ).annotate(next_value=Window( expression=Lead('value')), second_next_value=Window( expression=Lead('value', 2)), prev_value=Window(Lag('value')), second_prev_value=Window(Lag('value', 2)) ).order_by('date_time').exclude(exclude_next, exclude_prev ).annotate(x=F('date_time'), y=F('value')).order_by( 'date_time').values('x','y')

jayvynl commented 10 months ago

more details needed, please follow the bug template and open a new issue .

MidTin commented 8 months ago

django raised NotSupportedError: This backend does not support window expressions.